

extern unsigned char CLEAN_UP_IN_PROGRESS;

#define GLOBAL_SEMAPHORE_COUNT 15
extern GLOBALSEM_STRUCT GLOBAL_SEMAPHORE_LIST[GLOBAL_SEMAPHORE_COUNT];

extern GLOBALSEM_STRUCT SEGS_ORDERED_SEM;
extern GLOBALSEM_STRUCT PUBS_DEFINED_SEM;
extern GLOBALSEM_STRUCT START_DEFINED_SEM;
extern GLOBALSEM_STRUCT XREF_OK_SEM;
extern GLOBALSEM_STRUCT MAPLINES_OK_SEM;
extern GLOBALSEM_STRUCT PUT_DATA_SEM;
extern GLOBALSEM_STRUCT EXPS_DEFINED_SEM;
extern GLOBALSEM_STRUCT _SAY_VERBOSE_SEM;

extern GLOBALSEM_STRUCT GLOBALALLOC_SEM;
extern GLOBALSEM_STRUCT ERROR_SEM;
extern GLOBALSEM_STRUCT OOM_ERROR_SEM;
extern GLOBALSEM_STRUCT _ABORTER_SEM;

extern int SLR_PREV_SEG;
extern int SLR_NEXT_SEG;
extern int OLD_MATCHED_COUNT;
extern int OLD_OFFSET;
extern int SLRBUF_PTR;
extern int SLR_BYTES_LEFT;
extern int SLR_TMP_PTR;
extern int SLR_INPUT_PTR_OFFSET;
extern int SLR_INPUT_PTR_BASE;
extern int SLR_HASHES_BASE;
extern int SLR_DICTIONARY_BASE;
extern int SLR_STRUCT_BASE;
extern int HUF_PUT_PTR;
extern int NEXT_AVAIL;
extern int NEXT_AVAIL_2;
extern int SLR_CPOS;
extern int SLR_VARS;
extern int SLR_DATA;
extern int SLR_INBUF_LIMIT;
extern int SLR_WORD;
extern int SLR_MASK;
extern int SLR_SCAN_LIMIT;
extern int DEL_INST_COUNT;
extern int SLR_DICT_COUNT;
extern int SLR_DICT2_COUNT;
extern int PUTBYTE_ADDR1;
extern int PUTBYTE_ADDR2;
extern int PUTBYTE_TEMP;
extern int SEED_SIZE;

extern unsigned char _FINAL_ABORTING;
extern unsigned char AFTER_DEF_DONE;
extern unsigned char FUZZY_JUST_CHECK;
extern unsigned char ANY_PUBLICS;
extern unsigned char VERBOSE_OMF;
extern unsigned char FORCE_PATH;
extern unsigned char MAP_FLUSHED;

extern unsigned char INDIRECT_MODE;		// THESE GET CLEARED ON STARTUP

extern int PHYS_TABLE_ENTRIES;
extern void *PHYS_TABLE[PAGE_SIZE / sizeof(void *)];

extern unsigned char ASCIZ[NFN_TEXT_SIZE];
extern unsigned ASZIZ_LEN;
extern SEGMENT_STRUCT *FIRST_FINAL_SEGMENT_GINDEX;
extern unsigned CURN_OUTFILE_BASE_ADDRESS;
extern unsigned FIRST_MODULE_GINDEX;
extern unsigned LAST_MODULE_GINDEX;
extern unsigned MODULE_COUNT;
extern unsigned FIRST_MDB_GINDEX;
extern unsigned LAST_MDB_GINDEX;





extern int LIN_SIZE;
extern int SECTION_NUMBER;
extern int LAST_FILENAME_GINDEX;

extern struct MYO_STRUCT *IMP_DEVICE;
extern struct MYO_STRUCT *MAP_DEVICE;

extern int MAP_THREAD_ID;
extern void *MAP_THREAD_HANDLE;

extern void (*OUT_INIT)();		// INITIALIZE OUTPUT FILE
extern void (*OUT_NEW_SEGMENT)();	// NEW SEGMENT
extern void (*OUT_NEW_SEGMOD)();	// NEW SEGMOD
extern void (*OUT_SEGMOD_FINISH)();	// END OF A SEGMOD
extern void (*OUT_SEGMENT_FINISH)();	// END OF A SEGMENT
extern void (*OUT_END_OF_SEGMENTS)();	// END OF ALL SEGMENTS
extern void (*OUT_FLUSH_SEGMOD)();	// FLUSH A PARTIAL SEGMENT
extern void (*OUT_FLUSH_SEGMENT)();	// FLUSH A SEGMENT WITH RELOCS
extern void (*OUT_FLUSH_EXE)();		// LAST RE: OUT_TYPES
extern void (*OUT_NEW_SECTION)();
extern void (*OUT_END_OF_SECTION)();

#define OUT_TYPES 11





/*

		.CODE	ROOT_TEXT

		EXTERNDEF	CLASS_POOL_GET:PROC,TEXT_POOL_GET:PROC,SSYM_POOL_GET:PROC,SEGMENT_POOL_GET:PROC
		EXTERNDEF	SEGMOD_POOL_GET:PROC,GROUP_POOL_GET:PROC,ROOT_RET:PROC,MODULE_POOL_GET:PROC,TILLP2_POOL_GET:PROC
		EXTERNDEF	SECTION_POOL_GET:PROC,RELOC_POOL_GET:PROC,TD_GLOCAL_POOL_GET:PROC,IMPNAME_POOL_GET:PROC
		EXTERNDEF	ENTRYNAME_POOL_GET:PROC,PENT_POOL_GET:PROC,ENTRY_POOL_GET:PROC,TD_GTYPE_POOL_GET:PROC
		EXTERNDEF	ALLOC_LOCAL:PROC,TD_GCLASS_POOL_GET:PROC,PAGE_RELOC_POOL_GET:PROC,IMPMOD_POOL_GET:PROC
		EXTERNDEF	RESNAME_POOL_GET:PROC,RESTYPE_POOL_GET:PROC,RES_TYPENAME_POOL_GET:PROC,RTNL_POOL_GET:PROC
		EXTERNDEF	CV_GSYM_POOL_GET:PROC,CV_LTYPE_POOL_GET:PROC,CV_GTYPE_POOL_GET:PROC,CV_SSYM_POOL_GET:PROC
		EXTERNDEF	CV_HASHES_POOL_GET:PROC

		EXTERNDEF	LIBRARY_EQU:ABS,SEGCLASS_EQU:ABS,FILES_EQU:ABS,PUBSYMS_EQU:ABS,SEGMENTS_EQU:ABS,SEGMODS_EQU:ABS
		EXTERNDEF	GROUPS_EQU:ABS,MODULES_EQU:ABS,OUTFILES_EQU:ABS,AREAS_EQU:ABS,SECTIONS_EQU:ABS,CSEGS_EQU:ABS
		EXTERNDEF	RELOCS_EQU:ABS,SRCS_EQU:ABS,TDLOCALS_EQU:ABS,TDCLASSES_EQU:ABS,TDLTYPES_EQU:ABS,TDLCLASSES_EQU:ABS
		EXTERNDEF	TDLMEMBERS_EQU:ABS,IMPNAMES_EQU:ABS,ENTNAMES_EQU:ABS,PENTS_EQU:ABS,ENTRIES_EQU:ABS,IMPMODS_EQU:ABS
		EXTERNDEF	PAGE_RELOCS_EQU:ABS,RESNAMES_EQU:ABS,RESTYPES_EQU:ABS,RES_TYPENAMES_EQU:ABS,RTNLS_EQU:ABS
		EXTERNDEF	CVLTYPES_EQU:ABS,CVGSYMS_EQU:ABS,CVGTYPES_EQU:ABS,CVSSYMS_EQU:ABS,MDBS_EQU:ABS,CVHASHES_EQU:ABS


		.DATA

__stack			DD	64K
__psp			DD	?
__envptr		DD	?

if	fgh_dosx OR fgh_win32

		.DATA?

		PUBLIC	__envptr,PHYS_TABLE,PHYS_TABLE_ENTRIES

PHYS_TABLE_ENTRIES	DD	?

PHYS_TABLE		DD	PAGE_SIZE/4 DUP(?)

endif
		.DATA


if	fgh_win32dll
		PUBLIC	CMDLINE_BLOCK,MY_ARGC,MY_ARGV,TOOL_CALLBACKS,TOOL_MESSAGE,TOOL_DATA,HINSTANCE
		PUBLIC	YIELD_COUNT,GLOBAL_BLOCKS,HOST_ESP,ERROR_ASCIZ

		ALIGN	4

CMDLINE_BLOCK	DD	0
MY_ARGC		DD	0
MY_ARGV		DD	0
TOOL_CALLBACKS	TOOL_CALLBACKS_STRUCT	<VERSION_TOOLCALLBACKS>
TOOL_MESSAGE	TOOL_MESSAGE_STRUCT	<TOOLMSG_VERSION>
TOOL_DATA	TOOL_DATA_STRUCT	<TOOL_ACTIVITY,TOOL_TITLE,TOOL_COPYRIGHT,RELEASE_NUM>

HINSTANCE	DD	0
YIELD_COUNT	DD	0
HOST_ESP	DD	0

TOOL_ACTIVITY	DB	'LINKING',0
TOOL_TITLE	DB	'Digital Mars OPTLINK',174,' Version 7.00a1',0
TOOL_COPYRIGHT	DB	'Copyright ',169,' 1993-2004 Digital Mars',0

		.DATA?

GLOBAL_BLOCKS	DB	64K/8 DUP(?)

		.DATA

endif


if	fgh_inthreads

		PUBLIC	NEXT_READ_THREAD,NEXT_READLIB_THREAD
*/

extern int NEXT_READ_THREAD;
extern int NEXT_READLIB_THREAD;

/*
endif


if	fgh_outhreads
		PUBLIC	MRR_OTHREAD

MRR_OTHREAD	LABEL	BYTE
XXX		=	0
		REPT	N_W_THREADS
		DD	OFFSET MYO_STUFF + XXX
XXX = XXX+SIZE MYO_STRUCT
		ENDM

endif

;		DB	'** CHRIST is the Answer **'

if fg_virt

		PUBLIC	VMFILE_TEXT

VMFILE_TEXT	DB	'VM000000.TMP',0DH

endif

CRLF		DB	2,0DH,0AH

DEBUG_TYPES_SELECTED	DB	-1

if	fg_cv OR fg_td

		PUBLIC	CV_HEADER

		ALIGN	4

CV_HEADER	DB	'NB',14 DUP(-1)

endif

ife	fgh_win32
		PUBLIC	SHARE_ANDER,DOS_VERSION,DOSCALL_EAX,OLD_DTA,OLD_DTA_SEG
*/
extern char SHARE_ANDER;
/*
DOS_VERSION	DB	0
		DW	0
DOSCALL_EAX	DD	0
OLD_DTA		DD	0
OLD_DTA_SEG	DD	0

endif

		ALIGN	4

if	fg_segm OR fg_norm_exe
*/
extern EXE EXEHEADER;

/*
endif

if	fg_segm
		PUBLIC	NEXEHEADER,STUBPATH_LIST,STUB_LIST,OLD_LIST,RC_LIST,DEFFILE,IMPMOD_HASH_TABLE_PTR

		ALIGN	4
*/
extern NEXE NEXEHEADER;
/*
endif

if	fg_pe
*/

extern PEXE PEXEHEADER;
/*
endif

		.DATA?

if	fgh_dosx

		PUBLIC	SEG_RELEASED_256K,SEG_RELEASED_128K

SEG_RELEASED_256K	DD	?
SEG_RELEASED_128K	DD	?

endif

ZERO_BYTES	DD	?


		PUBLIC LAST_MODULE_GINDEX_EXT
LAST_MODULE_GINDEX_EXT	DD	?


COMDAT_VARS	LABEL	BYTE

COMDAT_ATTRIB	DB	?		;*
COMDAT_ALIGN	DB	?		;*
*/
extern unsigned char COMDAT_FLAGS;
/*
COMDAT_TYPE	DB	?		;*

COMDAT_OFFSET	DD	?
COMDAT_CV	DD	?

MYCOMDAT_LINDEX		DD	?
COMDAT_SEGMOD_LINDEX	DD	?
COMDAT_SEGMOD_GINDEX	DD	?
COMDAT_PARENT_SEGMOD_GINDEX	DD	?
COMDAT_DATA_PTR		DD	?
CODE_16_SEG_LEN		DD	?
DATA_16_SEG_LEN		DD	?
CODE_32_SEG_LEN		DD	?
DATA_32_SEG_LEN		DD	?
COMDAT_CODE_16_SEGMENT_GINDEX	DD	?
COMDAT_DATA_16_SEGMENT_GINDEX	DD	?
COMDAT_CODE_32_SEGMENT_GINDEX	DD	?
COMDAT_DATA_32_SEGMENT_GINDEX	DD	?
COMDAT_GROUP_LINDEX	DD	?
COMDAT_GINDEX		DD	?
*/
extern unsigned char COMDAT_REF_FLAGS;
extern unsigned char SYMBOL_TABLE_USE;
extern unsigned char MDB_TABLE_USE;
extern unsigned char MEMORY_MODEL;

extern int LAST_EXTDEF_GINDEX;
extern int LAST_PUBDEF_GINDEX;

extern int ENTRYPOINT_GINDEX;
extern int ENTRYPOINT_TXT;
extern char *ME_PTR;			// MY FILENAME IN ENVIRONMENT
extern int ME_PATH_LEN;
/*
DOSX_HDR_SIZE		DD	?

GROUP_PTRS		DD	20 DUP(?)
GROUP_PTRS_PTR		DD	?
GROUP_COUNT		DD	?

HOST_BASE		DD	?
*/
extern unsigned CURN_C_TIME;   // # OF SECONDS SINCE SOMETHING...

extern unsigned CURN_TIME_DWD;
extern unsigned CURN_DATE_DWD;

extern unsigned short CURN_YEAR;

extern unsigned char CURN_MONTH;
extern unsigned char CURN_DAY;

extern unsigned char CURN_HOUR;
extern unsigned char CURN_MINUTE;
extern unsigned char CURN_SECOND;
extern unsigned char CURN_HUNDREDTH;

/*
CURN_SEGMOD_GINDEX	DD	?

SOFT_SEGM	DD	?
STD_ALLOC_OFF	DD	?	;**
STD_ALLOC_LOG	DD	?	;**

NEXT_COMDAT_SEGNUM	DD	?
CIRCULAR_COUNT		DD	?

COMM_TYPE		DB	?
COMM_NUMBER		DB	?
			DW	?

COMM_SIZE_A		DD	?
COMM_SIZE_B		DD	?


		DD	?
FINAL_RANGES	DD	20 DUP(?)		;MAX 10 RANGES-IN-PROGRESS

;
;****  THESE MEMORY BLOCKS MUST BE RELEASED UPON CANCELLATION...
;
			DD	?			;I THINK THIS IS FOR SOME BUG WITH FINAL_TABLE
FINAL_TABLE		DD	40 DUP(?)		;MAX 20 PAGES-IN-PROGRESS
*/
extern unsigned char *CURN_DICT_LOG;
/*
RELOC_BITS_LOG		DD	?
if	fg_td
TD_IMPMOD_NAME		DD	?
TD_NAME_HASH_PHYS	DD	?
TD_GTYPE_HASH_LOG	DD	?
TD_GSMEM_HASH_LOG	DD	?
endif
if	fg_cv
CV_INDEX_TABLE	DD	1K/4/(PAGE_SIZE/(1K)) DUP(?)	;256K WORTH OF INDEX ENTRIES...
endif

;THIS STUFF IS UNINITIALIZED
;***************************
*/
extern NFN_STRUCT FILNAM;
extern NFN_STRUCT INDNAM;
extern NFN_STRUCT SRCNAM;

extern unsigned char LIB_HEADER[16];	// for reading library header

/*
FLOAT_FLAG	DB	?	;**
FLOAT_TYPE	DB	?	;**
*/

extern unsigned char CURN_TYPE;
/*
		DB	?	;AVAIL

		ALIGN	4

FORREF_TYPE	DD	?

if	exepack_support
		PUBLIC	EXEPACK_TEMP,EXEPACK_DANGLE_LEN,EXEPACK_BYTES,EXEPACK_SRC,EXEPACK_ROUTINE,EXEPACK_AX_SAVE,EXEPACK_DI_SAVE
		PUBLIC	EXEPACK_LIMIT,EXEPACK_SEGMENT_START,EXEPACK_TAIL_LIMIT,PACK_REPT_COUNT,PACK_SO_FAR,TARG_ADDR,EXEPACK_ZEROS

.DATA

		ALIGN	4

EXEPACK_TAIL_LIMIT	DD	7

.DATA?
		ALIGN	4

EXEPACK_TEMP	DB	32 DUP(?)

EXEPACK_BYTES		DD	?	;# OF SOURCE BYTES LEFT
EXEPACK_DANGLE_LEN	DD	?	;# OF BYTES LEFT DANGLING
EXEPACK_SRC		DD	?	;SOURCE ADDRESS
EXEPACK_ROUTINE		DCA	?	;PLACE TO RETURN TO
EXEPACK_AX_SAVE		DD	?
EXEPACK_DI_SAVE		DD	?
EXEPACK_LIMIT		DD	?
EXEPACK_SEGMENT_START	DD	?

PACK_REPT_COUNT		DD	?	;...
PACK_SO_FAR		DD	?	;...
TARG_ADDR		DD	?
EXEPACK_ZEROS		DD	?


endif

if	fg_pe

		PUBLIC	PE_OBJECT_ALIGN,PE_FIRST_OBJECT_RVA,LOWEST_ORDINAL,HIGHEST_ORDINAL,PE_BASE,CURN_PE_OBJECT_NUMBER
		PUBLIC	N_EXPORTS,N_EXPORTS_BYNAME,EXPORT_TEXT_SIZE,PE_NEXT_OBJECT_RVA,FIRST_OBJECT_FILE_ADDR,NEXT_OBJECT_FILE_ADDR
		PUBLIC	PE_EXEHDR_START,FORWARDER_TEXT_SIZE,PE_NEXT_SECTION_HDR,N_EXPORT_RVAS,EXPORT_ORDINAL_BASE,EXPORT_RVA_SIZE
		PUBLIC	CURN_PE_OBJECT_GINDEX,N_CODE_DATA_OBJECTS,FIRST_CODE_DATA_OBJECT_GINDEX,NAME_TEXT_SIZE,MODNAM_TEXT_SIZE
		PUBLIC	FIRST_CODE_DATA_OBJECT_NUMBER,PE_IMPORTS_OBJECT_GINDEX,PE_IMPORTS_OBJECT_NUMBER,PE_EXPORTS_OBJECT_NUMBER
		PUBLIC	N_IMPORTS_REFERENCED,N_MODULES_REFERENCED,PE_EXPORTS_OBJECT_GINDEX,ICODE_SEGMOD_GINDEX,ICODE_SM_START
		PUBLIC	ICODE_OS2_FLAGS,ICODE_PEOBJECT_NUMBER,ICODE_PEOBJECT_GINDEX,ICODE_SM_BASE_SEG_GINDEX,PE_THUNKS_RVA
		PUBLIC	PE_RELOC_COUNT,PAGE_RELOC_STUFF,CURN_PAGE_RELOC,PAGE_RELOC_GARRAY,CURN_PAGE_RELOC_GINDEX,tls_CLASS_GINDEX
		PUBLIC	PE_FIXUP_OBJECT_GINDEX,PE_FIXUP_OBJECT_NUMBER,PE_RSRC_OBJECT_GINDEX,PE_RSRC_OBJECT_NUMBER,_tls_used_GINDEX
		PUBLIC	PE_DEBUG_OBJECT_GINDEX,PE_DEBUG_OBJECT_NUMBER,FIRST__IMP__GINDEX,FIRST_PEOBJECT_GINDEX,LAST_PEOBJECT_GINDEX
		PUBLIC	LAST__IMP__GINDEX,IDATA_SEGMOD_GINDEX,LAST_PEOBJECT_NUMBER,FIRST_UNDECORATED_GINDEX,LAST_UNDECORATED_GINDEX
		PUBLIC	GOBJ1_SECT_RAW2_LEN,GOBJ1_SECTION_STUFF
		PUBLIC	FBN_SECT_RAW2_LEN,FBN_SECTION_STUFF
		PUBLIC	DBN_SECT_RAW2_LEN,DBN_SECTION_STUFF

.DATA
		ALIGN	4

PE_OBJECT_ALIGN		DD	1000H
LOWEST_ORDINAL		DD	-1
HIGHEST_ORDINAL		DD	0
PAGE_RELOC_GARRAY	STD_PTR_S <0,0,0,0,PAGE_RELOC_POOL_GET,PAGE_RELOCS_EQU>
;
;COFF Import Library Generation
;
GOBJ1_SECTION_STUFF	DB	'.idata$2'
                        DD	14h,144h,158h,3,0c0100040h
                        DB	'.idata$6'
GOBJ1_SECT_RAW2_LEN	DD	?
                        DD	176h,0,0,0c0200040h

FBN_SECTION_STUFF	DB	'.text',0,0,0
                        DD	6,0B4h,0BAh,1,60201020h
                        DB	'.idata$5'
                        DD	4,0C4h,0C8h,1,0c0301040h
                        DB	'.idata$4'
                        DD	4,0D2h,0D6h,1,0c0301040h
                        DB	'.idata$6'
FBN_SECT_RAW2_LEN	DD	?
                        DD	0E0h,0,0,0c0201040h

DBN_SECTION_STUFF	DB	'.idata$5'
                        DD	4,8Ch,90h,1,0c0301040h
                        DB	'.idata$4'
                        DD	4,09Ah,09Eh,1,0c0301040h
                        DB	'.idata$6'
DBN_SECT_RAW2_LEN	DD	?
                        DD	0A8h,0,0,0c0201040h

.DATA?

		ALIGN	4
*/
extern unsigned FIRST__IMP__GINDEX;
extern unsigned LAST__IMP__GINDEX;

extern SYMBOL_STRUCT *FIRST_UNDECORATED_GINDEX;

extern unsigned LAST_UNDECORATED_GINDEX;
extern unsigned PE_BASE;
extern unsigned PE_FIRST_OBJECT_RVA;
extern unsigned PE_NEXT_OBJECT_RVA;
extern unsigned FIRST_OBJECT_FILE_ADDR;
extern unsigned NEXT_OBJECT_FILE_ADDR;
extern unsigned EXPORT_TEXT_SIZE;
extern unsigned PE_EXEHDR_START;
extern unsigned FORWARDER_TEXT_SIZE;
extern unsigned PE_NEXT_SECTION_HDR;
extern unsigned EXPORT_RVA_SIZE;
extern unsigned NAME_TEXT_SIZE;
extern unsigned MODNAM_TEXT_SIZE;
extern unsigned ICODE_SM_START;
extern unsigned PE_THUNKS_RVA;
extern unsigned PE_RELOC_COUNT;

extern unsigned N_EXPORTS;
extern unsigned N_EXPORTS_BYNAME;
extern unsigned N_EXPORT_RVAS;
extern unsigned EXPORT_ORDINAL_BASE;
extern unsigned CURN_PE_OBJECT_GINDEX;
extern unsigned CURN_PE_OBJECT_NUMBER;
extern unsigned FIRST_CODE_DATA_OBJECT_GINDEX;
extern unsigned FIRST_CODE_DATA_OBJECT_NUMBER;
extern unsigned N_CODE_DATA_OBJECTS;
extern unsigned N_IMPORTS_REFERENCED;
extern unsigned N_MODULES_REFERENCED;
extern unsigned PE_IMPORTS_OBJECT_GINDEX;
extern unsigned PE_EXPORTS_OBJECT_GINDEX;
extern unsigned PE_FIXUP_OBJECT_GINDEX;
extern unsigned PE_RSRC_OBJECT_GINDEX;
extern unsigned PE_DEBUG_OBJECT_GINDEX;

extern unsigned PE_IMPORTS_OBJECT_NUMBER;
extern unsigned PE_EXPORTS_OBJECT_NUMBER;
extern unsigned PE_FIXUP_OBJECT_NUMBER;
extern unsigned PE_RSRC_OBJECT_NUMBER;
extern unsigned PE_DEBUG_OBJECT_NUMBER;
extern unsigned ICODE_SEGMOD_GINDEX;
extern unsigned ICODE_PEOBJECT_NUMBER;
extern unsigned ICODE_PEOBJECT_GINDEX;
extern unsigned ICODE_OS2_FLAGS;
extern unsigned ICODE_SM_BASE_SEG_GINDEX;

extern unsigned IDATA_SEGMOD_GINDEX;
extern unsigned CURN_PAGE_RELOC_GINDEX;

extern unsigned FIRST_PEOBJECT_GINDEX;
extern unsigned LAST_PEOBJECT_GINDEX;
extern unsigned LAST_PEOBJECT_NUMBER;

extern unsigned tls_CLASS_GINDEX;
extern unsigned _tls_used_GINDEX;

/*
CURN_PAGE_RELOC		PAGE_RELOC_STRUCT<>

PAGE_RELOC_STUFF	ALLOCS_STRUCT	<>

endif

if	fg_prot
		PUBLIC	FLAG_0C,FLAG_0C_MASK,EXE_DESCRIPTION,CODE_DEFAULTS,CODE_DEFAULTS_MASK,DATA_DEFAULTS,DATA_DEFAULTS_MASK
		PUBLIC	DEF_SEGMENT_GINDEX,SPECIFIC_MASK,SPECIFIC_FLAGS,HEAP_SIZE,EXETYPE_FLAG,SEGMENT_COUNT,FIRST_DIF_SEG_GINDEX,LAST_DIF_SEG_GINDEX
		PUBLIC	SEGMENT_NUMBER,SEGMENT_TABLE,LAST_SEG_OS2_NUMBER,OMF_NAME,EXETYPE_CMDLINE_FLAG
*/
extern unsigned FLAG_0C;
/*
FLAG_0C_MASK	 	DD	?
EXE_DESCRIPTION		DD	?
CODE_DEFAULTS_MASK	DD	?
DEF_SEGMENT_GINDEX	DD	?

.DATA

CODE_DEFAULTS		DD	0
DATA_DEFAULTS		DD	1

.DATA?

DATA_DEFAULTS_MASK	DD	?
SPECIFIC_MASK		DD	?
SPECIFIC_FLAGS		DD	?
HEAP_SIZE		DD	?
*/

extern unsigned char EXETYPE_FLAG;
/*
EXETYPE_CMDLINE_FLAG	DB	?
			DW	?	;AVAIL

SEGMENT_COUNT		DD	?
FIRST_DIF_SEG_GINDEX	DD	?
LAST_DIF_SEG_GINDEX	DD	?
SEGMENT_NUMBER		DD	?
*/
extern SEGTBL_STRUCT SEGMENT_TABLE[512];	// FOR SEGMENTS...
/*
LAST_SEG_OS2_NUMBER	DD	?
OMF_NAME		DD	?
;DEF_NUMBER		DD	?

endif
*/

extern unsigned char ASCIZ[NFN_TEXT_SIZE];
extern unsigned ASCIZ_LEN;
/*
FIRST_FINAL_SEGMENT_GINDEX	DD	?
CURN_OUTFILE_BASE_ADDRESS	DD	?
FIRST_MODULE_GINDEX	DD	?
LAST_MODULE_GINDEX	DD	?
MODULE_COUNT		DD	?
FIRST_MDB_GINDEX	DD	?
LAST_MDB_GINDEX		DD	?
*/
extern unsigned MDB_STRUCT_SIZE;
extern unsigned EXE_OUT_POSITION;
extern unsigned CURN_AREA_GINDEX;
extern unsigned AREA_COUNT;
extern unsigned SECTION_COUNT;

extern unsigned char *CURN_INPTR;
extern unsigned CURN_COUNT;
extern struct MYI_STRUCT *IND_DEVICE;

extern struct CMDLINE_STRUCT *FILESTUFF_PTR;


extern MYI_STRUCT *OBJ_DEVICE;
//MAX_LIBNUM	DW	?
//LIB_COUNT	DW	?
extern unsigned DICT_BLOCKS;
extern unsigned CURN_LIB_BLOCK;
extern void **CURN_LIB_BLOCK_PTR_LIMIT;
extern void **CURN_LS_BLOCK_TABLE_PTR;
extern void **LS_MODULE_PTR;
/*
NUMBLKS		DD	?

CNS_OFFSET	DD	?
*/
extern unsigned char *FSYMBEG;
extern unsigned FSYMEND;

//FSYMBOL_ARRAY	LARRAY_STRUCT<>
//FSYMBOLS	EQU	FSYMBOL_ARRAY
//FSYMBEG 	EQU	FSYMBOLS.FP_BASE
//FSYMEND 	EQU	FSYMBOLS.FP_NEXT
//FSYMLIM 	EQU	FSYMBOLS.FP_LIMIT


extern FA_S FCA_STUFF;		// FARCALL FIXUPPS FOR COUNTING RELOCS AND PENTS
//extern FA_S LNA_STUFF;
extern FA_S LDA_STUFF;		// FIXUPPS, FORREFS, LDATAS, ANYTHING NON-CODE
//extern FA_S GRP_STUFF;
extern FA_S DBG_SYM_STUFF;	// DEBUG_SYMBOLS, TYPES, LINNUMS
//extern FA_S DBG_TYP_STUFF;
extern FA_S COD_STUFF;		// FIXUPPS, FORREFS, LDATAS, ANYTHING 'CODE'

/*
OUTFILE_NUMBER		DD	?
FIRST_OUTFILE_GINDEX	DD	?
LAST_OUTFILE_GINDEX	DD	?
LAST_MYCOMDAT_LINDEX	DD	?

.DATA
*/

extern int SYM_HASH;
extern int UNDECO_HASH;
extern int UNDECO_HASH_PHYS;

/*
.DATA?

UNDECO_HASH_TABLE	DD	PRIME_1K DUP(?)
*/
extern void *SYM_HASH_LOG;
extern void *SYM_HASH_PHYS;
extern int SYM_HASH_BLK;
extern int SYM_HASH_MOD;
extern unsigned char *INPTR1;
extern int LISTTYPE;
extern FILE_LISTS LIB_LIST;
extern FILE_LISTS LIBPATH_LIST;
extern FILE_LISTS OBJ_LIST;
extern FILE_LISTS OBJPATH_LIST;
extern FILE_LISTS LOD_LIST;
#if	fg_segm
extern FILE_LISTS STUBPATH_LIST;
extern FILE_LISTS STUB_LIST;
extern FILE_LISTS OLD_LIST;
extern FILE_LISTS RC_LIST;
extern int DEFFILE;
#endif
extern unsigned char *ENVIRONMENT_BLOCK;
/*
FILENAME_HASH_TABLE	DD	FILENAME_HASH_SIZE DUP(?)
VIRDEF_MCD_HASH_TABLE	DD	VIRDEF_MCD_HASH_SIZE DUP(?)
THEADR_HASH_TABLE	DD	THEADR_HASH_SIZE DUP(?)

.DATA

LDATA_TYPE		DB	?
COMMENT_CHAR		DB	'#'
			DW	?	;AVAIL

FILENAME_HASH		DD	FILENAME_HASH_SIZE
FILENAME_HASH_TABLE_PTR	DD	FILENAME_HASH_TABLE
VIRDEF_MCD_HASH		DD	VIRDEF_MCD_HASH_SIZE
VIRDEF_MCD_HASH_TABLE_PTR	DD	VIRDEF_MCD_HASH_TABLE

THEADR_HASH		DD	THEADR_HASH_SIZE	;FOR STORING SRC FILE NAMES PER MODULE FOR DEBUGGING
THEADR_HASH_TABLE_PTR	DD	THEADR_HASH_TABLE

EMS_MAX_1K_BLOCKS	DD	-1
XMS_MAX_1K_BLOCKS	DD	-1

if	page_size EQ 8K

SEGMENT_HASH		DD	PRIME_1K
GROUP_HASH		DD	PRIME_256
MODULE_HASH		DD	PRIME_256
CLASS_HASH		DD	PRIME_256
LOCAL_HASH		DD	PRIME_256

SEGMENT_HASH_TABLE_PTR	DD	0			;FOR GLOBAL SEGMENT SEARCHING
GROUP_HASH_TABLE_PTR	DD	4K			;FOR GLOBAL GROUP SEARCHING
CLASS_HASH_TABLE_PTR	DD	5K			;FOR GLOBAL CLASS SEARCHING
MODULE_HASH_TABLE_PTR	DD	6K			;FOR MODULE-NAME SEARCHING
LOCAL_HASH_TABLE_PTR	DD	7K			;FOR LOCAL SYMBOL SEARCHING

else

SEGMENT_HASH		DD	PRIME_2K
GROUP_HASH		DD	PRIME_512
MODULE_HASH		DD	PRIME_512
CLASS_HASH		DD	PRIME_512
LOCAL_HASH		DD	PRIME_512
*/

extern void *SEGMENT_HASH_TABLE_PTR;
extern void *GROUP_HASH_TABLE_PTR;
extern void *CLASS_HASH_TABLE_PTR;
extern void *MODULE_HASH_TABLE_PTR;
extern void *LOCAL_HASH_TABLE_PTR;
/*
endif

PACKCODE		DD	65500		;WINDOWS CANNOT ALLOCATE 64K AT ONCE...
PACKDATA		DD	65500		;WINDOWS CANNOT ALLOCATE 64K AT ONCE...
ALIGNMENT		DD	0
SEG_TYPE_MASK_DEFAULT	DB	MASK SEG_RELOC
			DB	?
			DW	?

OPTI_STOSD_SIZE		DD	PAGE_SIZE/4
LOUTALL			DCA	ROOT_RET
IMP_OUTALL		DCA	ROOT_RET


.DATA?
*/
extern void *MULTI_HASH_LOG;
/*
MULTI_HASH_BLK		DD	?
TOKSTR			DD	?
*/
extern void *LOCAL_HASH_TABLE_PTR_OLD;

/*
CURN_SECTION_FILE_ADDRESS	DD	?

OVERLAY_NUMBER		DD	?
SEG_COMBINE		DB	?
SEG_ALIGN		DB	?
SEG32_FLAGS		DB	?
			DB	?
*/
extern unsigned SEG_FRAME;
/*
SEG_LEN			DD	?
SEG_NAME_LINDEX		DD	?
CLASS_NAME_LINDEX	DD	?
SEG_CLASS_GINDEX	DD	?
GROUP_NAME_LINDEX	DD	?
CLASS_DEBTYP_GINDEX	DD	?
CLASS_DEBSYM_GINDEX	DD	?
CLASS_DEBNAM_GINDEX	DD	?
*/
extern unsigned CLASS_TYPE;
extern unsigned RECORD_TYPE;
extern unsigned RECORD_LENGTH;

/*
FIRST_GROUP_GINDEX	DD	?
LAST_GROUP_GINDEX	DD	?

DGROUP_GINDEX		DD	?
FLAT_GINDEX		DD	?
_TEXT_SEGMENT_GINDEX	DD	?
CODE_CLASS_GINDEX	DD	?
BEGDATA_CLASS_GINDEX	DD	?
BSS_CLASS_GINDEX	DD	?
STACK_CLASS_GINDEX	DD	?
DEBTYP_CLASS_GINDEX	DD	?
DEBSYM_CLASS_GINDEX	DD	?
DEBNAM_CLASS_GINDEX	DD	?

FILE_HASH_MOD		DD	?
RELOC_COUNT		DD	?
TOTAL_RELOCS		DD	?
FIRST_RELOC_GINDEX	DD	?
LAST_RELOC_GINDEX	DD	?
FIXUPP_COUNT		DD	?
SP_SAVE			DD	?

OUT_INIT		DCA	?		;INITIALIZE OUTPUT FILE
OUT_NEW_SEGMENT		DCA	?		;NEW SEGMENT
OUT_NEW_SEGMOD		DCA	?		;NEW SEGMOD
OUT_SEGMOD_FINISH	DCA	?		;END OF A SEGMOD
OUT_SEGMENT_FINISH	DCA	?		;END OF A SEGMENT
OUT_END_OF_SEGMENTS	DCA	?		;END OF ALL SEGMENTS
OUT_FLUSH_SEGMOD	DCA	?		;FLUSH A PARTIAL SEGMENT
OUT_FLUSH_SEGMENT	DCA	?		;FLUSH A SEGMENT WITH RELOCS
OUT_FLUSH_EXE		DCA	?		;LAST RE: OUT_TYPES
OUT_NEW_SECTION		DCA	?
OUT_END_OF_SECTION	DCA	?

OUT_TYPES		EQU	($-OUT_INIT)/4

*/

extern void (*MAJOR_MOVE_ROUTINE)();
extern void (*FORREF_ROUTINE)();
extern void (*BOUTALL)();
extern void (*OPTI_MOVE)();	// upper/lower case or not
extern void (*OPTI_HASH)();
extern void (*CASE_STRING_COMPARE)();

/*
SEG_PAGE_SIZE_M1	DD	?
NOT_SEG_PAGE_SIZE_M1	DD	?
SEG_PAGE_SHIFT		DD	?
*/

struct FILE_LIST_STRUCT *CURN_FILE_LIST_GINDEX;

/*
FIRST_COMMUNAL_GINDEX	DD	?
LAST_COMMUNAL_GINDEX	DD	?
FIRST_VIRDEF_GINDEX	DD	?
LAST_VIRDEF_GINDEX	DD	?
FIRST_COMDAT_GINDEX	DD	?
LAST_COMDAT_GINDEX	DD	?
FIRST_COMDAT_ORDERED_GINDEX	DD	?
LAST_COMDAT_ORDERED_GINDEX	DD	?
RELOC_BITS		DD	?
LIDATA_RELOCS_NEXT	DD	?
LIDATA_RELOCS_START	DD	?
OPTI_RELOC_CLEAR	DD	?
RELOC_HIGH_WATER	DD	?
*/
extern unsigned HIGH_WATER;
/*
FINAL_HIGH_WATER	DD	?
OLD_HIGH_WATER		DD	?
NEW_REPT_ADDR		DD	?
LAST_SEGMOD_GINDEX	DD	?
*/
extern int CURNMOD_GINDEX;
extern int CURNMOD_NUMBER;
extern struct LIBRARY_STRUCT *CURNLIB_GINDEX;
/*
SYS_BASE		DD	?
;STACK_DELTA		DD	?
GINPUT_LINE_NUMBER	DD	?

END_OF_RECORD		DD	?
MAX_FINAL_TABLE		DD	?

MAX_FINAL_RANGES	DD	?
*/
extern unsigned LIB_TEMP_WORD;
/*

EXEHDR_ADDR		DD	?

MAP_DEVICE		DD	?
_EXE_DEVICE		DD	?
IMP_DEVICE		DD	?

HIGH_PC			DD	?
*/
extern struct SEGMENT_STRUCT *FIRST_STACK_GINDEX;
/*
LDATA_SEGMOD_GINDEX	DD	?	;FIXUPP&LEDATA
LAST_DATA_PTR		DD	?	;FIXUPP&LEDATA
PREV_DATA_PTR		DD	?	;...
LDATA_LENGTH	 	DD	?	;FIXUPP&LEDATA
LDATA_LOC		DD	?	;FIXUPP&LEDATA
*/
extern unsigned FIRST_SEGMENT_GINDEX;
extern unsigned LAST_SEGMENT_GINDEX;
extern unsigned FIRST_CLASS_GINDEX;
extern unsigned LAST_CLASS_GINDEX;
extern struct OUTFILE_STRUCT *_OUTFILE_GINDEX;
extern unsigned MAPFILE_GINDEX;
extern struct LIBRARY_STRUCT *FIRST_LIB_GINDEX;
extern struct LIBRARY_STRUCT *LAST_LIB_GINDEX;
extern struct LIBRARY_STRUCT *FIRST_REQUEST_LIB_GINDEX;
extern struct LIBRARY_STRUCT *LAST_REQUEST_LIB_GINDEX;
extern struct SYMBOL_STRUCT *FIRST_WEAK_GINDEX;
extern unsigned LAST_WEAK_GINDEX;
extern unsigned FIRST_WEAK_DEFINED_GINDEX;
extern unsigned LAST_WEAK_DEFINED_GINDEX;
extern struct SYMBOL_STRUCT *FIRST_EXTERNAL_GINDEX;
extern unsigned LAST_EXTERNAL_GINDEX;
extern struct SYMBOL_STRUCT *FIRST_ALIASED_GINDEX;
extern unsigned LAST_ALIASED_GINDEX;
extern unsigned FIRST_ALIAS_DEFINED_GINDEX;
extern unsigned LAST_ALIAS_DEFINED_GINDEX;
extern struct SYMBOL_STRUCT *FIRST_LAZY_GINDEX;
extern unsigned LAST_LAZY_GINDEX;
extern unsigned FIRST_LAZY_DEFINED_GINDEX;
extern unsigned LAST_LAZY_DEFINED_GINDEX;
extern unsigned MOD_FIRST_SRC_GINDEX;
extern unsigned MOD_LAST_SRC_GINDEX;
extern unsigned SRC_COUNT;
extern unsigned MOD_FIRST_CSEGMOD_GINDEX;
extern unsigned MOD_CSEG_COUNT;
extern unsigned N_MDB_STRUCTS;
extern unsigned N_SYMBOLS;

/*
FIRST_COMDAT_SUGGESTED	DD	?	;RECORD DESCRIBING COMDAT ORDERING
LAST_COMDAT_SUGGESTED	DD	?
EXTDEF_DELTA		DD	?
LINNUM_DELTA		DD	?
NULL_TEXT_SEGMOD_GINDEX	DD	?
*/
extern unsigned LIB_MODULES;
extern unsigned LIB_MODULE_PTR_BLOCKS;
extern unsigned LIB_MODULE_PTR_LAST_OFFSET;
extern unsigned MAX_PAGEDWORD;
extern void **CURN_LIB_BLOCK_PTR;
/*
LS_BLOCK		DD	?
PLINK_LEVEL		DD	?
DONT_PACK		DD	?	;# OF BYTES TO PASS THRU EXE OR SLRPAC
R_DONT_PACK		DD	?
FIRST_FARCALL		DD	?
LAST_FARCALL	 	DD	?
RELOC_CHUNK_COUNT	DD	?
INDIRECT_LEVEL		DD	?

FIRST_CODE_GROUP_GINDEX	DD	?
LAST_CODE_GROUP_GINDEX	DD	?
FIRST_DATA_GROUP_GINDEX	DD	?
LAST_DATA_GROUP_GINDEX	DD	?
FIRST_CODE_SEGMENT_GINDEX	DD	?
FIRST_DATA_SEGMENT_GINDEX	DD	?
LAST_CODE_SEGMENT_GINDEX	DD	?
LAST_DATA_SEGMENT_GINDEX	DD	?
SEGMENT_TABLE_PTR	DD	?
INDIR_TABLE		DD	INDIRECT_NEST_LIMIT+1 DUP(?)	;FOR NESTING @ FILES
FIRST_AREA_GINDEX	DD	?
LAST_SECTION_GINDEX	DD	?
FIRST_SECTION_GINDEX	DD	?
FIRST_SECTION_PLTYPE	DB	?
			DB	?
			DW	?
*/
extern int ERR_NUMBER;
/*
CURN_OUTFILE_GINDEX 	DD	?
CURN_SECTION_GINDEX 	DD	?
CURN_PLTYPE		DB	?
LAST_DELIM		DB	?
			DW	?

CODEVIEW_SECTION_GINDEX	DD	?
CODEVIEW_PLTYPE		DB	?
LINSYM_FLAGS		DB	?
			DW	?

WM_START_ADDR		DD	?

SEG_SECTION_GINDEX	DD	?
SEG_PLTYPE		DB	?
			DB	?	;AVAIL?
			DW	?

LIN_GROUP_GINDEX	DD	?
LIN_SEGMOD_GINDEX	DD	?

LIN_SRC_GINDEX		DD	?

LIN_SIZE		DD	?
SECTION_NUMBER		DD	?
LAST_FILENAME_GINDEX	DD	?

PUB_FRAME		DD	?	;**
PUB_OFFSET		DD	?	;**
PUB_CV			DD	?	;**
PUB_TYPE		DD	?	;**
PUB_SIZE		DD	?	;**
PUB_GROUP_GINDEX	DD	?	;**
PUB_SEGMOD_GINDEX	DD	?	;**

LIN_LAST_LINNUM		DD	?

PAGEWIDTH		DD	?	;**
PAGELENGTH		DD	?	;**

CV_INFO_TYPE	 	DB	?	;**
CASE_TYPE		DB	?	;**
TD_INFO_TYPE		DB	?	;**
			DB	?	;**

PACK_DEFAULT_SIZE	DD	?	;**
*/

extern unsigned LIB_PAGE_SIZE;
extern unsigned DICT_OFFSET;
extern unsigned SELECTED_LIB_COUNT;
/*
RAINBOW_HASH_MOD	DD	?
DEFAULT_SIZE		DD	?
LNKDIR_PCODE_CV		DD	?
LNKDIR_FLAGS		DB	?
			DB	?
			DW	?

LINNUM_ADDER		DD	?
DOSSEG_STRUC		DB	4*16 DUP(?)
;LIB_USED_SYMBOLS	DD	?
*/
extern void *LIB_UNUSED_SYMBOLS_GINDEX;
extern unsigned TYPDEF_ANDER;
extern unsigned CURN_LIB_MODULE;
/*
QN_PTR			DD	?

C_COMMON_SEGMOD_GINDEX	DD	?
FAR_BSS_SEGMOD_GINDEX	DD	?
FORREF_SIZE		DD	?
*/
extern unsigned STACK_SIZE;
/*
MODEND_OWNER_GINDEX 	DD	?
MODEND_ADDRESS		DD	?

MOD_FIRST_PUBLIC_GINDEX	DD	?

BUFFER_OFFSET		DD	?

LOC_11_FIX		DD	?
LOC_10			DD	?
LOC_CALLTBL_PTR		DD	?

SRCADR			DD	?

_ERR_COUNT		DD	?
WARN_COUNT		DD	?

EDI_SAVE		DD	?
OTHERS_SAVE		DD	6 DUP(?)
*/

extern struct LARRAY_STRUCT LNAME_LARRAY;
/*
SEGMOD_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)
GROUP_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)
SYMBOL_LARRAY		DB	SIZE LARRAY_STRUCT DUP(?)

LNAME_LARRAY_TBL	DD	256 DUP(?)
SEGMOD_LARRAY_TBL	DW	256 DUP(?)
GROUP_LARRAY_TBL	DW	256 DUP(?)
SYMBOL_LARRAY_TBL	DW	256 DUP(?)

.DATA

*/
extern struct STD_PTR_S LIBRARY_GARRAY;
extern struct STD_PTR_S CLASS_GARRAY;
extern struct STD_PTR_S _FILE_LIST_GARRAY;
extern struct STD_PTR_S SYMBOL_GARRAY;
extern struct STD_PTR_S SEGMENT_GARRAY;
extern struct STD_PTR_S SEGMOD_GARRAY;
extern struct STD_PTR_S GROUP_GARRAY;
extern struct STD_PTR_S MODULE_GARRAY;
extern struct STD_PTR_S OUTFILE_GARRAY;
extern struct STD_PTR_S AREA_GARRAY;
extern struct STD_PTR_S SECTION_GARRAY;
extern struct STD_PTR_S CSEG_GARRAY;
extern struct STD_PTR_S RELOC_GARRAY;
extern struct STD_PTR_S SRC_GARRAY;
extern struct STD_PTR_S MDB_GARRAY;
/*

.DATA?

if	debug
			PUBLIC	ALLOCATED_BLOCKS,DISK_IO_COUNT,EMS_IO_COUNT,ALLOCATED_IO_BLOCKS,TYPE_COLLISION_COUNT
			PUBLIC	TYPE_COLLISION_TID,TYPE_COLLISION_MAX

ALLOCATED_BLOCKS	DD	?
ALLOCATED_IO_BLOCKS	DD	?
DISK_IO_COUNT		DD	?
EMS_IO_COUNT		DD	?

TYPE_COLLISION_COUNT	DD	?
TYPE_COLLISION_MAX	DD	?
TYPE_COLLISION_TID	DB	?
			DB	?
			DW	?
endif

CTRL_C_FLAG		DB	?
LAST_CHAR		DB	?
REFERENCE_FLAGS		DB	?
MCD_FLAGS		DB	?

if	any_overlays
			PUBLIC	CLASS_SECTION,CLASS_PLTYPE,VECTOR_COUNT,OVERLAY_INTERRUPT_NUMBER,RELOAD_DEPTH,OVL_LIMIT,FILE_FLAGS
			PUBLIC	VECTOR_TABLE_ADDRESS,SECTION_SIZE,SLR_CODE,SLR_VECTORS,SLR_SECTIONS,SLR_HDR_TABLE,OVERLAY_NUMBER
			PUBLIC	SLR_RELOAD_STACK,VECTOR_SIZE,FILE_SECTION,FILE_PLTYPE,FILE_PLINK_FLAGS,MAX_LEVEL
			PUBLIC	COMPRESS_DEFAULT_BYTE,CACHE_DEFAULT_BYTE,SLR_FNAMES
			PUBLIC	VECTOR_SECTION_FILE_ADDRESS,SECTION_PARAS
			PUBLIC	OVR_INIT_ADDR,SLR_CODE_HEADER,CACHE_BLOCK_COUNT,CACHE_ORDER,OVL_PANIC_PARAS
			PUBLIC	OVL_DELTA_PARAS,DATA_SECTION,DATA_PLTYPE
			PUBLIC	ALLO_LAST_BLOCK,MOD_SECTION,MOD_PLTYPE,END_VECTOR_TABLE,SLR_CODE_CLASS
			PUBLIC	SLR_SCODE_CLASS

.DATA

OVERLAY_INTERRUPT_NUMBER	DW	3FH
COMPRESS_DEFAULT_BYTE	DB	1
CACHE_DEFAULT_BYTE	DB	1

.DATA?

CLASS_SECTION		DD	?
CLASS_PLTYPE		DB	?
			DB	?	;AVAIL

MOD_SECTION		DD	?
MOD_PLTYPE		DB	?
			DB	?	;AVAIL

VECTOR_COUNT	 	DW	?
;RELOAD_TYPE		DW	?
RELOAD_DEPTH 		DW	?
FILE_FLAGS		DW	?
MAX_LEVEL		DW	?	;MAX NESTING LEVEL

VECTOR_TABLE_ADDRESS 	DD	?
END_VECTOR_TABLE	DD	?
SECTION_PARAS		DW	?

OVERLAY_NUMBER		DW	?
SECTION_SIZE 		DW	?	;SIZE OF ENTRY IN SECTION TBL
SLR_CODE		DD	?
SLR_VECTORS		DD	?
SLR_SECTIONS 		DD	?
SLR_HDR_TABLE		DD	?
SLR_FNAMES		DD	?
SLR_RELOAD_STACK	DD	?
SLR_CODE_CLASS		DD	?
SLR_SCODE_CLASS		DD	?
VECTOR_SIZE		DW	?
FILE_SECTION	 	DD	?
FILE_PLTYPE		DB	?
FILE_PLINK_FLAGS	DB	?
VECTOR_SECTION_FILE_ADDRESS	DD	?
;OVR_EXTRN_END		DW	?
OVR_INIT_ADDR		DD	?	;ADDR OF OVR_INIT SYMBOL
SLR_CODE_HEADER		DD	?
CACHE_BLOCK_COUNT	DW	?
CACHE_ORDER		DW	?	;

OVL_LIMIT		DW	?
OVL_PANIC_PARAS		DW	?	;
OVL_DELTA_PARAS		DW	?	;
DATA_SECTION	 	DD	?
DATA_PLTYPE		DB	?
			DB	?	;AVAIL
ALLO_LAST_BLOCK		DW	?

endif

if	fg_plink

			PUBLIC	PLINK_SPSAVE,PL_DFLT_RADIX,PL_COUNT,PAGE_HEIGHT,PAGE_WIDTH,NAME_WIDTH,WORKFILE,MAP_FLAGS

.DATA

PL_DFLT_RADIX		DW	16

.DATA?

PLINK_SPSAVE	 	DW	?
PL_COUNT		DW	?
PAGE_HEIGHT		DW	?
PAGE_WIDTH		DW	?
NAME_WIDTH		DW	?
WORKFILE		DD	?
MAP_FLAGS		DB	?
			db	?
endif

if	fg_slrpack

		PUBLIC	SLR_PREV_SEG,SLRBUF_PTR,NEXT_AVAIL,NEXT_AVAIL_2,COMPRESS_TABLE,COMPRESS_TABLE_LENGTH,PUTSTUFF_SMALL
		PUBLIC	PUTSTUFF,SLR_FLUSHSTUFF,FIX_BUFFERS,SLR_NEXT_SEG,OLD_MATCHED_COUNT,OLD_OFFSET,SEED_SIZE,SLR2_TABLE
		PUBLIC	SLR_CPOS,SLR_VARS,SLR_DATA,SLR_INBUF_LIMIT,SLR_WORD,SLR_HASHES_BASE,SLR_DICTIONARY_BASE,SLR_STRUCT_BASE
		PUBLIC	SLR_SCAN_LIMIT,DEL_INST_COUNT,SLR_DICT_COUNT,SLR_DICT2_COUNT,PUTBYTE_ADDR1,PUTBYTE_ADDR2,PUTBYTE_TEMP
		PUBLIC	SLR_MASK,SLR_BYTES_LEFT,SLR_TMP_PTR,SLR_INPUT_PTR_BASE,SLR_INPUT_PTR_OFFSET,HUF_PUT_PTR,HASH_TABLE2_OFFSET
		PUBLIC	HUF_MINI_BUFFER


SLR_PREV_SEG		DD	?
SLR_NEXT_SEG		DD	?
OLD_MATCHED_COUNT	DD	?
OLD_OFFSET		DD	?
SLRBUF_PTR		DD	?
SLR_BYTES_LEFT		DD	?
SLR_TMP_PTR		DD	?
SLR_INPUT_PTR_OFFSET	DD	?
SLR_INPUT_PTR_BASE	DD	?
SLR_HASHES_BASE		DD	?
SLR_DICTIONARY_BASE	DD	?
SLR_STRUCT_BASE		DD	?
HUF_PUT_PTR		DD	?
NEXT_AVAIL		DD	?
NEXT_AVAIL_2		DD	?
SLR_CPOS		DD	?
SLR_VARS		DD	?
SLR_DATA		DD	?
SLR_INBUF_LIMIT		DD	?
SLR_WORD		DD	?
SLR_MASK		DD	?
SLR_SCAN_LIMIT		DD	?
DEL_INST_COUNT		DD	?
SLR_DICT_COUNT		DD	?
SLR_DICT2_COUNT		DD	?
PUTBYTE_ADDR1		DD	?
PUTBYTE_ADDR2		DD	?
PUTBYTE_TEMP		DD	?
SEED_SIZE		DD	?

COMPRESS_TABLE		LABEL	WORD
PUTSTUFF_SMALL		DD	?
PUTSTUFF		DD	?
SLR_FLUSHSTUFF		DD	?
FIX_BUFFERS		DD	?
COMPRESS_TABLE_LENGTH	EQU	$-COMPRESS_TABLE

HASH_TABLE2_OFFSET	DD	HTW2_SIZE DUP(?)
SLR2_TABLE		DB	256 * SIZE SLR2_STRUCT DUP(?)
HUF_MINI_BUFFER 	DB	HMB_SIZE DUP(?)

endif

if	alloc_support

		PUBLIC	PUBALLOC_STUFF,LIBALLOC_STUFF

PUBALLOC_STUFF		ALLOCS_STRUCT	<>
LIBALLOC_STUFF		ALLOCS_STRUCT	<>
endif

LNAME_STUFF		ALLOCS_STRUCT	<>		// USED FOR TEMPORARY STORAGE OF LNAME TEXTS, ETC, ALLOC_LOCAL
RELOC_STUFF		ALLOCS_STRUCT	<>
*/
extern ALLOCS_STRUCT SSYM_STUFF;
extern ALLOCS_STRUCT P1ONLY_STUFF;			// ORDERING INFO FOR COMDATS, REFERENCES FOR COMDATS, LIBRARY STRUCTURES
/*
TILLMIDDLE_STUFF	ALLOCS_STRUCT	<>		;LOCAL SYMBOLS, 'HUGE' INFO, MODULES
;TILLP2_STUFF		ALLOCS_STRUCT	<>		;CVPACK FILENAME, CSEG, SRC, OUTFILE, START_ADDRESS,MODULE_NAME,DESCRIPTION
*/
extern ALLOCS_STRUCT SEGMENT_STUFF;
/*
;SEGMOD_STUFF		ALLOCS_STRUCT	<>		;SEGMODS - SEGMENT_STUFF
;MODULE_STUFF		ALLOCS_STRUCT	<>		;HASHED MODULES - SEGMENT_STUFF
;GROUP_STUFF		ALLOCS_STRUCT	<>		;GROUPS - SEGMENT_STUFF
;CLASS_STUFF		ALLOCS_STRUCT	<>		;CLASSES - SEGMENT_STUFF
;SECTION_STUFF		ALLOCS_STRUCT	<>		;SECTIONS, AREAS - SEGMENT_STUFF
;TEXT_STUFF		ALLOCS_STRUCT	<>		;FILENAMES,LIBRARIES - SEGMENT_STUFF

XREF_STUFF		ALLOCS_STRUCT	<>
UNMANGLE_STUFF		ALLOCS_STRUCT	<>

LOCKED_STUFF		LKD_ALLOC_STRUCT<>

		ALIGN	4
*/

extern unsigned char OUTBUF[INBUF_LEN * 2];
extern unsigned char INBUF[INBUF_LEN];

/*
;		DW	1A1AH
;INBUFO 	DB	INBUF_LEN DUP(?)	;FOR NESTING INTO @ FILE


if	fgh_dpmi

		PUBLIC	PHYS_TABLE,OLD_GP_FAULT,STARTING_SP,OLD_GP_FAULT_HI,PMODE,PHYS_IO_TEMP,DOS_SELECTORS,MAX_DOS_SELECTOR

PHYS_TABLE	DW	4 DUP(?)
PHYS_IO_TEMP	DW	2 DUP(?)

OLD_GP_FAULT	DD	?
OLD_GP_FAULT_HI	DW	?
PMODE		DW	?
STARTING_SP	DW	?

DOS_SELECTORS	DW	64*16/(PAGE_SIZE/1024) DUP(?)

		.DATA

MAX_DOS_SELECTOR	DW	DOS_SELECTORS

		.DATA?
endif

if	fgh_win

		PUBLIC	HPREV,CMDSHOW,PHYS_TABLE

PHYS_TABLE	DW	4 DUP(?)
HPREV		DW	?
CMDSHOW		DW	?

endif


if	fgh_anythreads

		PUBLIC	GLOBALALLOC_SEM,_SAY_VERBOSE_SEM,ERROR_SEM,GLOBAL_SEMAPHORE_LIST,GLOBAL_SEMAPHORE_COUNT
		PUBLIC	OOM_ERROR_SEM,_ABORTER_SEM

if	fgh_outhreads
		PUBLIC	OUTPUT_DEVICE_LIST_SEM
endif

if	fgh_mapthread
		PUBLIC	PUBS_DEFINED_SEM,START_DEFINED_SEM,XREF_OK_SEM,MAPLINES_OK_SEM,MAP_THREAD_ID,MAP_THREAD_HANDLE
		PUBLIC	SEGS_ORDERED_SEM,PUT_DATA_SEM,EXPS_DEFINED_SEM
endif

if	fgh_inthreads
		PUBLIC	NONRES_LENGTH,_NONRES_LENGTH_SEM,LIB_ORDER_SEM,LIB_THREAD_LOCALS,RES_LENGTH
		PUBLIC	THREAD_LOCALS,LAST_FILENAME_OPENED,LIB_REQUEST_ORDER_SEM
endif

		.DATA?

		ALIGN	4

GLOBAL_SEMAPHORE_LIST	LABEL	QWORD

if	fgh_inthreads
*/
extern GLOBALSEM_STRUCT _NONRES_LENGTH_SEM;
extern GLOBALSEM_STRUCT LIB_ORDER_SEM;
extern GLOBALSEM_STRUCT LIB_REQUEST_ORDER_SEM;
/*
;STUB_OLD_DONE_SEM	GLOBALSEM_STRUCT	<>	;NO LONGER A SEPARATE THREAD...
endif

if	fgh_mapthread
SEGS_ORDERED_SEM	GLOBALSEM_STRUCT	<>
PUBS_DEFINED_SEM	GLOBALSEM_STRUCT	<>
START_DEFINED_SEM	GLOBALSEM_STRUCT	<>
XREF_OK_SEM		GLOBALSEM_STRUCT	<>
MAPLINES_OK_SEM		GLOBALSEM_STRUCT	<>
PUT_DATA_SEM		GLOBALSEM_STRUCT	<>
EXPS_DEFINED_SEM	GLOBALSEM_STRUCT	<>
_SAY_VERBOSE_SEM		GLOBALSEM_STRUCT	<>
endif

GLOBALALLOC_SEM		GLOBALSEM_STRUCT	<>
ERROR_SEM		GLOBALSEM_STRUCT	<>
OOM_ERROR_SEM		GLOBALSEM_STRUCT	<>
_ABORTER_SEM		GLOBALSEM_STRUCT	<>

if	fgh_outhreads
OUTPUT_DEVICE_LIST_SEM	GLOBALSEM_STRUCT	<>
endif

GLOBAL_SEMAPHORE_COUNT	EQU	($-GLOBAL_SEMAPHORE_LIST)/SIZE GLOBALSEM_STRUCT

if	fgh_inthreads
*/

extern void *LAST_FILENAME_OPENED;

/*
THREAD_LOCALS		DD	N_R_THREADS DUP(?)
*/
extern MYL2_STRUCT *LIB_THREAD_LOCALS[N_R_THREADS];
extern unsigned NONRES_LENGTH;
extern unsigned RES_LENGTH;
/*
endif

if	fgh_mapthread

MAP_THREAD_ID		DD	?
MAP_THREAD_HANDLE	DD	?

endif

endif


if fg_cv

		PUBLIC	CV_INDEX_TABLE,CV_HEADER_LOC,CV_INDEX_BLK,CV_INDEX_PTR,CV_INDEX_BLK_PTR,CV_INDEX_COUNT,CV_INDEX_TEMP
		PUBLIC	CV_TYPE,CVPACK_ADDR,CVPACK_PID,MOD_CV_TYPES_SEGMOD,MOD_CV_SYMBOLS_SEGMOD,CV_NUL_SYMBOLS_SEGMOD
		PUBLIC	CV_TEMP_RECORD,LAST_CV_MODULE_GINDEX,CV_NUL_TYPES_SEGMOD,MOD_CV_NAMES_SEGMOD
		PUBLIC	CURN_TYPE_MODULE,CURN_SYMBOL_MODULE,CURN_TYPE_SEGMOD_GINDEX,CURN_SYMBOL_SEGMOD_GINDEX,CV_HEADER_LOC_PHYS
		PUBLIC	CV_NUL_NAMES_SEGMOD,CV_SEGMENT_COUNT,CV_GROUP_COUNT,FIRST_NAMESP_GINDEX,LAST_NAMESP_GINDEX,CV_LIB_COUNT
		PUBLIC	FIRST_CV_SEGMENT_GINDEX,LAST_CV_SEGMENT_GINDEX,FIRST_CV_GROUP_GINDEX,LAST_CV_GROUP_GINDEX
		PUBLIC	FIRST_CV_LIB_GINDEX,LAST_CV_LIB_GINDEX

		.DATA?

CV_TEMP_RECORD	DB	CV_TEMP_SIZE DUP(?)

CV_HEADER_LOC		DD	?
*/

void **CV_INDEX_BLK_PTR;

/*
CV_INDEX_BLK		DD	?
*/
extern void *CV_INDEX_PTR;
extern unsigned CV_INDEX_COUNT;
extern unsigned char CV_INDEX_TEMP[12];
/*

;CV_LIN_PHYS		DW	?
;CV_LIN_BLK		DW	?
;CV_LN_STUFF		DB	SIZE LINNUM_HEADER_TYPE DUP(?)
;CV_MOD_STUFF	 	DB	SIZE MODULE_STRUCT DUP(?)
;CV_LINNUM_COUNT		DW	?
;CV_LINNUM_COUNT_ADDR	DD	?
;CV_LAST_GROUP		DD	?
;CV_LAST_SEGMOD		DD	?
;CV_FRAME		DW	?
;CV_LN_FACTOR	 	DW	?
*/
extern int CURNLIB_NUMBER;
extern unsigned BYTES_SO_FAR;
/*
LAST_CV_MODULE_GINDEX	DD	?
CVPACK_ADDR		DD	?		;ADDRESS OF VALID CVPACK.EXE TEXT

CURN_TYPE_SEGMOD_GINDEX	DD	?	;**
CURN_TYPE_MODULE	DD	?	;**

CURN_SYMBOL_SEGMOD_GINDEX	DD	?	;**
CURN_SYMBOL_MODULE	DD	?	;**

CV_TYPE			DD	?
CVPACK_PID		DD	?

CV_SEGMENT_COUNT	DD	?
CV_GROUP_COUNT		DD	?
FIRST_CV_SEGMENT_GINDEX	DD	?
LAST_CV_SEGMENT_GINDEX	DD	?
FIRST_CV_GROUP_GINDEX	DD	?
LAST_CV_GROUP_GINDEX	DD	?
FIRST_NAMESP_GINDEX	DD	?
LAST_NAMESP_GINDEX	DD	?
*/
extern unsigned CV_LIB_COUNT;
extern struct LIBRARY_STRUCT *FIRST_CV_LIB_GINDEX;
extern struct LIBRARY_STRUCT *LAST_CV_LIB_GINDEX;
/*
;ADJUST_SEGMOD		DD	?Z	;
CV_HEADER_LOC_PHYS	DD	?

MOD_CV_TYPES_SEGMOD	DD	?
MOD_CV_SYMBOLS_SEGMOD	DD	?
MOD_CV_NAMES_SEGMOD	DD	?
CV_NUL_TYPES_SEGMOD	DD	?
CV_NUL_SYMBOLS_SEGMOD	DD	?
CV_NUL_NAMES_SEGMOD	DD	?

endif

if	fg_cvpack

		PUBLIC	CV_LTYPE_GARRAY,GSYM_HASH,GSYM_HASH_LOG,CV_GSYM_GARRAY,CV_GSYM_STUFF,CV_ASYM_STRUCTURE
		PUBLIC	CV_REFSYM_CNT,CV_LTYPE_STUFF,CVG_SYMBOL_HASH,CVG_SYMBOL_OFFSET,CVG_SEGMENT_OFFSET
		PUBLIC	CVG_SEGMENT,CV_GTYPE_GARRAY,CV_GTYPE_HASH_LOG,CV_GTYPE_HASH,CV_GTYPE_STUFF
		PUBLIC	SSYM_HASH_LOG,SSYM_HASH,FIRST_GSYM_GINDEX,LAST_GSYM_GINDEX,FIRST_SSYM_GINDEX,LAST_SSYM_GINDEX,CV_SSYM_GARRAY
		PUBLIC	CV_SSYM_STUFF,LAST_CVH_SEGMENT,CV_HASHES_STUFF,CV_HASHES_GARRAY
		PUBLIC	CV_LTYPE_SPECIAL_BLOCK,CV_LTYPE_OVERSIZE_CNT
		PUBLIC	CV_GTYPE_SPECIAL_BLOCK,CV_GTYPE_OVERSIZE_CNT
    .DATA

		ALIGN	4
*/

extern unsigned GSYM_HASH;
extern unsigned SSYM_HASH;
extern unsigned CV_GTYPE_HASH;

extern STD_PTR_S CV_GTYPE_GARRAY;
extern STD_PTR_S CV_GSYM_GARRAY;
extern STD_PTR_S CV_SSYM_GARRAY;
extern STD_PTR_S CV_LTYPE_GARRAY;
extern STD_PTR_S CV_HASHES_GARRAY;

extern ALLOCS_STRUCT CV_GSYM_STUFF;
extern ALLOCS_STRUCT CV_SSYM_STUFF;
extern ALLOCS_STRUCT CV_LTYPE_STUFF;
extern ALLOCS_STRUCT CV_GTYPE_STUFF;
extern ALLOCS_STRUCT CV_HASHES_STUFF;

extern unsigned CV_LTYPE_OVERSIZE_CNT;
extern void* CV_LTYPE_SPECIAL_BLOCK;

extern unsigned CV_GTYPE_OVERSIZE_CNT;
extern void* CV_GTYPE_SPECIAL_BLOCK;

/*
;CV_SSEARCH_PARRAY	PAR_PTR_S<>
;CV_STATICSYM_PARRAY	PAR_PTR_S<>
;CV_HASHES_PARRAY	PAR_PTR_S<>
;CV_LFWD_PARRAY		PAR_PTR_S<>
*/

extern SEQ_STRUCT CV_ASYM_STRUCTURE;
/*
endif

if	fg_cvpack AND fg_pe
			ORG CV_ASYM_STRUCTURE
else if fg_pe
.DATA
endif

if	fg_pe

                PUBLIC  COFF_HELPERS_STRUCTURE
COFF_HELPERS_STRUCTURE	SEQ_STRUCT<>
endif
if	fg_cvpack
			DD	1K/(PAGE_SIZE/1024) DUP(?)
*/

extern void **GSYM_HASH_LOG;
extern unsigned SSYM_HASH_LOG;
extern unsigned CV_REFSYM_CNT;
extern unsigned CV_GTYPE_HASH_LOG;
extern unsigned LAST_CVH_SEGMENT;

extern unsigned CVG_SYMBOL_OFFSET;
extern unsigned CVG_SYMBOL_HASH;
extern unsigned CVG_SEGMENT_OFFSET;
extern unsigned CVG_SEGMENT;

extern void *FIRST_GSYM_GINDEX;
extern void *LAST_GSYM_GINDEX;
extern unsigned FIRST_SSYM_GINDEX;
extern unsigned LAST_SSYM_GINDEX;
/*
endif
if	fg_td

		PUBLIC	TD_HEADER_LOC,TD_GLOBAL_BASE,TD4_HEADER,TD3_HEADER,TD_SYMBOL_PARRAY,TD_NAME_HASH,TD_NAME_HASH_PHYS
		PUBLIC	TD_NAME_GARRAY32,TD_NAME_STUFF,TD_MAJOR,TD_MINOR,TD_CURRENT_SCOPE,MOD_TD_COMP_PARAMS,MOD_PREV_CSEGS
		PUBLIC	MOD_TD_OPTFLAGS,MOD_TD_FIRST_LOCAL,TD_LSCOPE_PARRAY,TD_N_OPTSYMS,TD_N_GSCOPES,TD_N_LSCOPES,TD_OPTSYM_PARRAY
		PUBLIC	TD_GSCOPE_PARRAY,TD_GLOCAL_GARRAY32,TD_GLOCAL_STUFF,MOD_TD_LOCALS_INDEX32,MOD_TD_LOCALS_COUNT,MOD_TD_FIRST_CLASS
		PUBLIC	TD_OPTIMIZATIONS_FLAG,TD_LSRC_PARRAY,TD_MODULES_BASE,TD_SRCFILES_BASE,TD_N_CORRELATIONS,TD_N_LINES
		PUBLIC	TD_CORRELATIONS_PARRAY,TD_SCOPES_BASE,TD_COUNT_CSEGS,TD_OUTER_SCOPE,TD_LAST_COVERAGE,TD_COVERAGE_PARRAY
		PUBLIC	TD_N_COVERAGES,TD_COVERAGE_MAP_BASE,TD_LTYPE_GARRAY,TD_SMEM_STARTING_INDEX,TD_LCLASS_GARRAY,TD_GTYPE_HASH
		PUBLIC	TD_GTYPE_HASH_PHYS,TD_GTYPE_GARRAY32,TD_GTYPE_STUFF,TD_SMEM_RUNNING_HASH,TD_SMEM_RUNNING_COUNT,TD_GSMEM_HASH
		PUBLIC	TD_LSMEM_GARRAY,TD_GSMEM_HASH_PTR,TD_GCLASS_HASH,TD_GCLASS_HASH_PTR,TD_GSMEM_GARRAY32,TD_GCLASS_GARRAY
		PUBLIC	TD_GTYPE_HASH_LOG,TD_GTYPE_HASH_BLK,TD_GSMEM_HASH_LOG,TD_GSMEM_HASH_BLK,TD_GSMEM_STUFF,TD_GCLASS_STUFF
		PUBLIC	MATCHED_BUFFER,LAST_TD_MATCHED,MATCHED_COUNT,MATCHED_PTR,FIRST_WEP_GINDEX,TD_IMPMOD_NAME


		.DATA?

TD_HEADER_LOC		DD	?
TD_GLOBAL_BASE		DD	?
TD_MODULES_BASE		DD	?
TD_SRCFILES_BASE	DD	?
TD_SCOPES_BASE		DD	?
TD_COVERAGE_MAP_BASE	DD	?

TD_GTYPE_HASH_PHYS	DD	?
TD_GTYPE_HASH_BLK	DD	?
TD_GSMEM_HASH_BLK	DD	?
TD_GSMEM_HASH_PTR	DD	?
TD_GCLASS_HASH_PTR	DD	?

TD_MAJOR		DB	?
TD_MINOR		DB	?
			DW	?

TD_N_LSCOPES		DD	?
TD_N_OPTSYMS		DD	?
TD_N_GSCOPES		DD	?
TD_N_CORRELATIONS	DD	?
TD_N_COVERAGES		DD	?
TD_N_LINES		DD	?
TD_COUNT_CSEGS		DD	?
TD_CURRENT_SCOPE	DD	?
TD_OUTER_SCOPE		DD	?
TD_SMEM_STARTING_INDEX	DD	?
TD_SMEM_RUNNING_COUNT	DD	?
TD_SMEM_RUNNING_HASH	DD	?
TD_OPTIMIZATIONS_FLAG	DD	?
MOD_TD_COMP_PARAMS	DD	?
MOD_PREV_CSEGS		DD	?
MOD_TD_LOCALS_INDEX32	DD	?
MOD_TD_LOCALS_COUNT	DD	?
MOD_TD_OPTFLAGS		DD	?
MOD_TD_FIRST_LOCAL	DD	?
MOD_TD_FIRST_CLASS	DD	?
TD_LAST_COVERAGE	DD	?
FIRST_WEP_GINDEX	DD	?

MATCHED_COUNT		DD	?
MATCHED_PTR		DD	?
LAST_TD_MATCHED		DD	?

MATCHED_BUFFER		DD	16 DUP(?)

TD4_HEADER		TD4_HEADER_STRUCT<>
TD3_HEADER		TD3_HEADER_STRUCT<>

TD_NAME_GARRAY32	STD32_PTR_S<>
TD_GTYPE_GARRAY32	STD32_PTR_S<>
TD_GSMEM_GARRAY32	STD32_PTR_S<>
TD_GLOCAL_GARRAY32	STD32_PTR_S<>

;TD_GLOCAL_GARRAY32	STD_PTR_S<0,0,0,0,TD_GLOCAL_POOL_GET,TDLOCALS_EQU>

TD_NAME_STUFF		ALLOCS_STRUCT<>
TD_GLOCAL_STUFF		ALLOCS_STRUCT<>
TD_GTYPE_STUFF		ALLOCS_STRUCT<>
TD_GSMEM_STUFF		ALLOCS_STRUCT<>
TD_GCLASS_STUFF		ALLOCS_STRUCT<>

TD_SYMBOL_PARRAY	PAR_PTR_S<>
TD_LSCOPE_PARRAY	PAR_PTR_S<>
TD_GSCOPE_PARRAY	PAR_PTR_S<>
TD_OPTSYM_PARRAY	PAR_PTR_S<>
TD_LSRC_PARRAY		PAR_PTR_S<>
TD_COVERAGE_PARRAY	PAR_PTR_S<>

TD_CORRELATIONS_PARRAY	EQU	TD_LSCOPE_PARRAY

PARALLELS		SEGMENT	WORD PUBLIC	'DATA'

			DD	TD_SYMBOL_PARRAY
			DD	TD_LSCOPE_PARRAY
			DD	TD_GSCOPE_PARRAY
			DD	TD_OPTSYM_PARRAY
			DD	TD_LSRC_PARRAY
			DD	TD_COVERAGE_PARRAY

PARALLELS		ENDS

.DATA

		ALIGN	4

TD_GCLASS_GARRAY	STD_PTR_S<0,0,0,0,TD_GCLASS_POOL_GET,TDCLASSES_EQU>
TD_LTYPE_GARRAY		STD_PTR_S<0,0,0,0,ALLOC_LOCAL,TDLTYPES_EQU>
TD_LCLASS_GARRAY	STD_PTR_S<0,0,0,0,ALLOC_LOCAL,TDLCLASSES_EQU>
TD_LSMEM_GARRAY		STD_PTR_S<0,0,0,0,ALLOC_LOCAL,TDLMEMBERS_EQU>

.DATA

if	PAGE_SIZE EQ 8K

SYM_SHIFTS	EQU	300H+10
SYM_MASK	EQU	3FFH
SYM_BLK_CNT	EQU	64
TD_NAME_HASH	DD	PRIME_2K
TD_GTYPE_HASH	DD	PRIME_2K

TD_GSMEM_HASH	DD	PRIME_1K
TD_GCLASS_HASH	DD	PRIME_2K

else

SYM_SHIFTS	EQU	300H+11
SYM_MASK	EQU	7FFH
SYM_BLK_CNT	EQU	32
TD_NAME_HASH	DD	PRIME_4K
TD_GTYPE_HASH	DD	PRIME_4K

TD_GSMEM_HASH	DD	PRIME_2K
TD_GCLASS_HASH	DD	PRIME_4K

endif


.DATA?
endif

if	fg_xref
		PUBLIC	XREF_PTR,FIRST_XREF_BLK,XR_CURNMOD_GINDEX,XREF_PHYS_BLK,LAST_XR_CURNMOD_GINDEX

		ALIGN	4

XREF_PTR		DD	?
FIRST_XREF_BLK		DD	?
XR_CURNMOD_GINDEX	DD	?
LAST_XR_CURNMOD_GINDEX	DD	?
XREF_PHYS_BLK		DD	?

endif

if fg_virt

		public	BLOCK_TABLE,VIRTUAL_TABLE,EMS_PAGES,EMS_HANDLE1,EMS_HANDLE2,EMS_READ_STRUC,PHYS_LRU_BLOCK,VMFILE_BLK
		public	EMS_XMS_BLOCK,E_VIRTUAL_TABLE,EMS_WRITE_STRUC,EMS_PAGE_FRAME,EMS_PAGE_FRAME_END,PHYS_MRU_BLOCK,VIR_DEVICE
		PUBLIC	MINI_EMS_PAGE,VIRTUAL_NEXT,EMS_XMS_MRU,EMS_XMS_LRU,EMS_XMS_BOF,EMS_XMS_EOF,EMS_XMS_FREE_COUNT,HANDLE_HOLDER
		PUBLIC	XMS_LENGTH,XMS_SRC_HANDLE,XMS_SRC_OFFSET,XMS_DST_HANDLE,XMS_DST_OFFSET,XMS0_STUFF,XMS1_STUFF,XMS,VMFILE_GINDEX
		PUBLIC	UMB_PARAGRAPHS,PHYS_BEG_FREELIST,PHYS_END_FREELIST,EMS_XMS_BLOCK_LOG,PAGES_MAPPED,BLOCK_NEXT,PACK_TEMP_WORD
		PUBLIC	LS_MODULE_BLOCK,E_BLOCK_TABLE

.DATA

BLOCK_NEXT		DD	BLOCK_TABLE
VIRTUAL_NEXT		DD	VIRTUAL_TABLE
PAGES_MAPPED		DB	0
			DB	?		;AVAIL


.DATA?

PHYS_MRU_BLOCK		DW	?
PHYS_LRU_BLOCK		DW	?
PHYS_BEG_FREELIST	DW	?
PHYS_END_FREELIST	DW	?

BLOCK_TABLE		DW	32K/(PAGE_SIZE/1024) DUP(?);LOGICAL BLOCK FLAGS	*3/2
E_BLOCK_TABLE		LABEL	BYTE
VIRTUAL_TABLE		DW	32K/(PAGE_SIZE/1024) DUP(?);PTRS BACK TO BLOCK_TABLE  *3/2
E_VIRTUAL_TABLE 	LABEL	BYTE
;MRU_TABLE		DB	1K/(PAGE_SIZE/1024) DUP(?);LRU BUFFERING STUFF
EMS_XMS_BLOCK		DW	?		;EMS_XMS_STRUCT	8K/(PAGE_SIZE/1024) DUP(<>);EMS-XMS LRU STUFF
EMS_XMS_BLOCK_LOG	DW	?
;E_EMS_XMS_TABLE LABEL	BYTE
EMS_PAGES		DW	?	;# OF AVAILABLE EMS 16K PAGES
EMS_HANDLE1		DW	?
EMS_HANDLE2		DW	?
EMS_READ_STRUC		DB	18 DUP(?)
EMS_WRITE_STRUC		DB	18 DUP(?)
EMS_PAGE_FRAME		DW	?
EMS_PAGE_FRAME_END	DW	?
MINI_EMS_PAGE		DW	?
EMS_XMS_MRU		DW	?
EMS_XMS_LRU		DW	?
EMS_XMS_BOF		DW	?
EMS_XMS_EOF		DW	?
EMS_XMS_FREE_COUNT	DW	?

XMS_LENGTH		DD	?
XMS_SRC_HANDLE		DW	?
XMS_SRC_OFFSET		DD	?
XMS_DST_HANDLE		DW	?
XMS_DST_OFFSET		DD	?

XMS0_STUFF		DB	SIZE XMS_STRUC DUP(?)
XMS1_STUFF		DB	SIZE XMS_STRUC DUP(?)

XMS			DD	?
UMB_PARAGRAPHS		DW	5 DUP(?)

VMFILE_BLK		DW	?
HANDLE_HOLDER		DW	?
VIR_DEVICE		DW	?
VMFILE_GINDEX		DW	?
LS_MODULE_BLOCK		DW	?
PACK_TEMP_WORD		DW	?

endif
*/
extern void *EXETABLE[(32*1024)/(PAGE_SIZE/1024)]; // MAX FILE IS 32 MEG
/*
if	fg_slrpack
		PUBLIC	EXEPACK_STRUCTURE
EXEPACK_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)
		DD	1K/(PAGE_SIZE/1024) DUP(?)
endif

EXESTR_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)	;64K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K
			DD	32K/PAGE_SIZE*2*12 DUP(?);1Mb TOTAL

REAL_RELOC_STRUCT	DB	SIZE SEQ_STRUCT DUP(?)		;WHEN USE FOR LIBNAMES, 10,000 SYMBOLS
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K	;10K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K	;10K
			DD	32K/PAGE_SIZE*2 DUP(?)	;64K	;10K

EXP_BUFFER		DD	64K/(PAGE_SIZE/4) DUP(?)	;MAX 64K EXPORTED SYMBOLS TO SORT

*/
extern TPTR_STRUCT SYMBOL_TPTR;

extern unsigned SYMBOL_MODULE;
extern unsigned SYMBOL_HASH;
extern unsigned SYMBOL_LENGTH;
extern unsigned char SYMBOL_TEXT[SYMBOL_TEXT_SIZE];


/*
PRE_THREADS	THREAD_STUFF_STRUCT 	8 DUP(<>)

*/

extern unsigned char MODULE_NAME[SYMBOL_TEXT_SIZE + 2];

extern unsigned char TEMP_RECORD[MAX_RECORD_LEN + 131]; // plus room for name string+counts

#define LIBASE_TEMP_RECORD	TEMP_RECORD

/*
		ALIGN	4
TEMP_DATA_RECORD DB	MAX_LEDATA_LEN+64 DUP(?)	;FOR STORING LDATA DURING FIXUPP

NEW_FIXUPP	DB	NEW_FIXUPP_SIZE DUP(?)

TEMP_FIXUPP_RECORD	EQU	NEW_FIXUPP

if	fg_rom
		PUBLIC	OMF_BUFFER

OMF_BUFFER	DB	1K+32 DUP(?)

endif

if	fg_norm_exe

		PUBLIC	FARCALL_FIXUPP

FARCALL_FIXUPP	DB	INBUF_LEN DUP(?)	;MAX SIZE PER RECORD
endif

		ALIGN	4
FORREF_TEMP_RECORD	DB	4 DUP(?)	;

if	fg_segm OR fg_slrpack
		PUBLIC	ZEROS_16

		ALIGN	4
ZEROS_16	DB	16 DUP(?)

endif

		ALIGN	4

DOFLAG		MACRO	FLAG
		PUBLIC	FLAG
FLAG		DB	?
NUM_FLAGS	=	NUM_FLAGS+1
		ENDM

NUM_FLAGS	=	0

;	FIRST THE CONFIGURABLE FLAGS

FLAGS	LABEL	BYTE

extern unsigned char TD_FLAG;
extern unsigned char DOSSEG_FLAG;
*/
extern unsigned char STACK_GROUP_FLAG;

extern unsigned char CMDLINE_FREEFORMAT;	// CHECKSUM_EXE_FLAG
extern unsigned char XREF_OUT;
extern unsigned char SYMBOLS_OUT;
extern unsigned char ABORT_ON_CHECKSUM;
extern unsigned char DO_CHECKSUMING;		// FOR OBJ'S

extern unsigned char ECHO_INDIRECT;
extern unsigned char PAUSE_FLAG;
extern unsigned char INFORMATION_FLAG;

extern unsigned char EXEPACK_SELECTED;
extern unsigned char LINENUMBERS_FLAG;
extern unsigned char PRINT_GROUP;
extern unsigned char DEFAULTLIBRARYSEARCH_FLAG;
extern unsigned char PACKFUNCTIONS_FLAG;	// ALLOW_LIB_FILES 	;CPARMAXALLOC_FLAG EQU	15

/*
extern unsigned char $$SLR_CODE_FIRST;		// DSALLOCATE_FLAG1
*/
extern unsigned char _DELETE_EXE_ON_ERROR;
extern unsigned char GROUPASSOCIATION_FLAG;
extern unsigned char CODEVIEW_FLAG;
extern unsigned char BATCH_FLAG;
extern unsigned char FARCALLTRANSLATION_FLAG;
extern unsigned char PACKCODE_FLAG;
extern unsigned char PACKCODE_NO_SEGMENTS;

extern unsigned char PRESERVE_IMPEXP_CASE;
extern unsigned char ECHO_ANY;
extern unsigned char CHECK_LO_BYTE;
extern unsigned char ALPHA_ORDER_ALSO;
extern unsigned char SCAN_LINK_ENVIRONMENT;
extern unsigned char ERROR_NOT_REFERENCED;
extern unsigned char NODOSSEG_FLAG;
extern unsigned char HANDLE_EXE_ERRORFLAG;

extern unsigned char NULLSDOSSEG_FLAG;
extern unsigned char PACKDATA_FLAG;
extern unsigned char NOPACKCODE_FLAG;
extern unsigned char NOFARCALLTRANSLATION_FLAG;
extern unsigned char TRIED_UMB;
extern unsigned char TRIED_XMS;
extern unsigned char TRIED_EMS;
extern unsigned char FORCE_EMS_32;

extern unsigned char EMS_IO_LEGAL;
extern unsigned char CHECK_RELOCATIONS;
extern unsigned char LOGO_OUTPUT;
extern unsigned char PLUS_FOUND;
extern unsigned char DETAILEDMAP_FLAG;
extern unsigned char FIXDS_FLAG;
extern unsigned char IGNORE_DUP_STARTS;
extern unsigned char DOTS_FLAG;

extern unsigned char DUP_MODNAMS_PLEASE;
extern unsigned char REORDER_ALLOWED;
extern unsigned char ALLOW_WINDOWS_EXEPACK;
extern unsigned char ROOT_ENVIRONMENT_LEGAL;
extern unsigned char EXEPACK_DOSAPP;
extern unsigned char EXEPACK_WINAPP;
extern unsigned char EXEPACK_OS2APP;
extern unsigned char EXEPACK_WINDLL;

extern unsigned char EXEPACK_OS2DLL;
extern unsigned char WARN_LIB_DUPS;
extern unsigned char PREV_DEF_IS_ERROR;
extern unsigned char LIB_NOT_FOUND_FATAL;
extern unsigned char SCAN_LIB_ENVIRONMENT;
extern unsigned char CVPACK_FLAG;
extern unsigned char COMDEF_SEARCH;
extern unsigned char CMDLINE_FINAL;

extern unsigned char NT_HOST_FLAG;
extern unsigned char CV_WARNINGS;

/*
;
;	THESE FLAGS ARE JUST CLEARED AT STARTUP
;

	IF	NUM_FLAGS AND 7
	DB	8-(NUM_FLAGS AND 7) DUP(?)
	ENDIF

NUM_FLAGS	=	(NUM_FLAGS+7) AND 0FFF8H	;NEXT BYTE BOUNDARY
*/

extern unsigned char INDIRECT_MODE;		// THESE GET CLEARED ON STARTUP
extern unsigned char KEEPING_LINNUMS;
//extern unsigned char DRIVE_VALID;
//extern unsigned char SOURCE_PATH;
//extern unsigned char PRINTER_IN_USE;
//extern unsigned char CURN_GROUP_IS_DGROUP;
extern unsigned char VIRTUAL_FILE_OPEN;
//extern unsigned char IS_386;
extern unsigned char MINI_EMS_FLAG;
extern unsigned char FOUND_BASE;
extern unsigned char DURING_OBJ;		// FILES BEING PROCESSED
extern unsigned char REC_TYPE_VALID;		// FOR ERRORS
extern unsigned char OUTPUT_COM_SYS;		// COM OR SYS
extern unsigned char OUTPUT_COM;
extern unsigned char OUTPUT_SYS;
//extern unsigned char READ_ANY_LIBS;
extern unsigned char LIB_TYPE;
//extern unsigned char CVINFO_THIS_MODULE;	// CODEVIEW STUFF IN THIS MODULE
extern unsigned char _CRITI_IN_PROGRESS;
extern unsigned char CLEAN_UP_IN_PROGRESS;
extern unsigned char STACK_SIZE_FLAG;
//extern unsigned char ASEG_FLAG;
extern unsigned char LAST_DATA_KEEP;
extern unsigned char OBJS_DONE;
extern unsigned char LIBS_DONE;
//extern unsigned char DOING_LIBS;
//extern unsigned char DOING_OUTPUTS;
//extern unsigned char MAP_STARTED;
extern unsigned char ABORTING;
extern unsigned char FORCE_PATH;
//extern unsigned char LIB_OPENED;
extern unsigned char THIS_AMBIGUOUS;		// CURRENT COMMAND IS AMBIGUOUS
//extern unsigned char MAP_SORT_FAIL;
extern unsigned char LAST_DATA_LIDATA;
extern unsigned char FOUND_THEADR;
extern unsigned char LIB_OR_NOT;
extern unsigned char FINAL_FIXUPPS;
extern unsigned char NEW_LINHEADER;
extern unsigned char OUT_FLUSHED;
extern unsigned char DOING_DEBUG;
extern unsigned char FORCE_CREATE;
/*
extern unsigned char SYMBOL_UNDEFINED;	// USED BY FIXUPP2
extern unsigned char CV_SEPARATE;
;extern unsigned char DEF_NUMBER_GOTTEN;
extern unsigned char DEF_IN_PROGRESS;
;extern unsigned char LAST_ORDER_SEGMENT;
extern unsigned char SKIP_ORDERING;
;extern unsigned char FIRST_ORDER_SEGMENT;
extern unsigned char OUTPUT_ABS;
extern unsigned char HEX_NEW_SEGMENT;
extern unsigned char SEGAT_NEW;
extern unsigned char SEGAT_WRAP;
extern unsigned char RHEADR_FLAG;
extern unsigned char OMITTING_SEGMENT;
;extern unsigned char SKIP_SIGNAL;
;extern unsigned char DOING_PHASE;
extern unsigned char OMF_LINES;
extern unsigned char OMF_PUBLICS;
extern unsigned char OMF_NEW_SEGGRP;
;extern unsigned char EOF_CRITICAL;
;extern unsigned char MODE_SELECTED;
extern unsigned char REALMODE;
extern unsigned char PROTMODE;
;extern unsigned char STUB_PROCESSING;
extern unsigned char STUB_SUPPLIED;
extern unsigned char OLD_SUPPLIED;
extern unsigned char ENTRIES_POSSIBLE;
*/
extern unsigned char OUTPUT_SEGMENTED;

extern unsigned char OUTPUT_SEGMENTED;
extern unsigned char IOPL_USED;
extern unsigned char MOVABLE_USED;
extern unsigned char IMP_BY_NAME;
//extern unsigned char INCREMENTAL;
extern unsigned char WARNFIXUP;
extern unsigned char OS2_FLAGS_DIFFERED;
extern unsigned char MOVE_BYTES;
extern unsigned char ANY_LNAMES;
extern unsigned char DISKFULL_FIXING;
extern unsigned char OPENT_DOING_STUB;
extern unsigned char DOING_NODEF;
extern unsigned char EMS_HANDLE1_VALID;
extern unsigned char EMS_HANDLE2_VALID;
extern unsigned char ALIGNMENT_SPECIFIED;
extern unsigned char OS2_PAGE_ALIGN_DONE;
extern unsigned char EXEPACK_FLUSHING;
extern unsigned char EXEPACK_USING_NEW;
extern unsigned char BELOW_100_WARNED;
extern unsigned char SIGNON_DONE;
//extern unsigned char DEF_NUMBER_ILLEGAL;
extern unsigned char PARSE_IN_OVERLAY;
extern unsigned char DEBUGGING_THIS;
extern unsigned char FANCY_DEBUG;
/*
if	fg_slrpack
extern unsigned char SLRPACK_FLAG;		// ACTIVE THIS SECTION
extern unsigned char SLRPACK_SELECTED;		// REQUESTED AT ALL BY COMMAND
extern unsigned char SPECIAL_ZERO_AXCX;
extern unsigned char DICT_FULL;
extern unsigned char DICT2_FULL;
extern unsigned char KEEPING_COMPRESSED;
;extern unsigned char SLRPACK_SUFFICIENT;
extern unsigned char NO_SLRPACKING_DONE;
extern unsigned char HUF_FIRST_TIME;
extern unsigned char COMP_FIRST_INPUT;
extern unsigned char QUIKPACK_FLAG;
endif
if	fg_winpack
*/
extern unsigned char WINPACK_SELECTED;
extern unsigned char SEGPACK_SEGMENT;
extern unsigned char SEGPACK_SELECTED;
extern unsigned char WINPACK_LICENSED;
/*
endif
extern unsigned char FIRST_REPT_STORED;
extern unsigned char LONGNAMES_FLAG;
extern unsigned char NEW_CV_INFO;
;extern unsigned char CONST_FLAG;
;extern unsigned char STACK_SIZE_CHANGED;
extern unsigned char GET_LINE_PARTIAL;
extern unsigned char INBUF_EOF;
if	any_overlays
extern unsigned char DOING_OVERLAYS;
extern unsigned char OVERLAY_CLASS_DEFINED;
extern unsigned char ANY_ALLOCATABLE;
extern unsigned char SLROVL_ADDED;
extern unsigned char DOING_RELOAD;
extern unsigned char ALWAYSALL_FLAG;
extern unsigned char SEGMOD_MOVED;
extern unsigned char MULTI_LEVEL_MULTI_AREA;
extern unsigned char USE_OVERLAY_INT;
extern unsigned char SEXE_LOAD_PARA_FLAG;
extern unsigned char SEXE_END_PARENT_FLAG;
extern unsigned char SEXE_LENGTH_FLAG;
extern unsigned char SEXE_FILES_FLAG;
extern unsigned char DEBUG_FLAG;
extern unsigned char ALLOCATE_ALL;
extern unsigned char VECTORED_REFERENCE;
endif
if	fg_plink
extern unsigned char CACHE_STATISTICS_FLAG;
extern unsigned char PL_PCNT;
extern unsigned char PL_K;
extern unsigned char PL_VALUE;
extern unsigned char SPECIFIC_PUBLICS;
extern unsigned char EXCEPT_PUBLICS;
extern unsigned char NOLOCALS_FLAG;
extern unsigned char SPECIFIC_LOCALS;
endif
*/
extern unsigned char IGNORE_PRESERVE;
//extern unsigned char STACK_ALIGNED;
extern unsigned char SEGMENTS_MAP;
extern unsigned char MAPFILE_SELECTED;
extern unsigned char DEFFILE_SELECTED;
//extern unsigned char DOING_FIRST_SECTION;
extern unsigned char CHAINING_RELOCS;
extern unsigned char PACKING_RELOCS;
extern unsigned char EXEPACK_BODY;
extern unsigned char REFERENCING_LIBS;
//extern unsigned char WEAK_DEFINED;
extern unsigned char DOING_START_ADDRESS;


#if	fg_segm || fg_pe
extern unsigned char RC_SUPPLIED;
extern unsigned char RC_REORDER;
extern unsigned char RC_REORDER_SEGS;
extern unsigned char RC_GUESSED;
extern unsigned char STUB_NONE;
extern unsigned char HEAP_MAXVAL;
extern unsigned char RC_PRELOADS;
extern unsigned char NOEMUFLOAT_FLAG;
extern unsigned char FORCE_DOS_MODE;
extern unsigned char EXEHDR_ERROR_FLAG;
extern unsigned char IMPLIB_FLAG;
extern unsigned char IMPLIB_COFF_FLAG;
extern unsigned char IMPDEF_FLAG;
extern unsigned char WINVER_SELECTED;
extern unsigned char RES_32_BIT;
extern unsigned char POST_INSTALL_FIX;
#endif

extern unsigned char OPREADS_DONE;

extern unsigned char PMLIB_FLAG;
extern unsigned char BIG_ENDIAN_FLAG;
extern unsigned char LNKDIR_FLAG;
extern unsigned char NEED_MODULES_SEARCHED;
extern unsigned char USING_TEMP_RECORD;
extern unsigned char DID_DICT_OFFSET;
extern unsigned char NEED_MODULES_INSTALLED;
extern unsigned char SKIP_OUTFILE_LINK;
extern unsigned char CV_4_TYPE;
extern unsigned char CV_SYM1_TYPE;
extern unsigned char LAST_DATA_COMDAT;
extern unsigned char PCODE_NEW_EXE;
extern unsigned char PCODE_OMIT_PUBLICS;
extern unsigned char PCODE_RUN_MPC;
extern unsigned char PCH_HERE;
extern unsigned char MAP_FLUSHED;
extern unsigned char CVPACK_RUNNING;
//if	fg_td
extern unsigned char KEEPING_THIS_TDBG;
extern unsigned char TDBG_F9_FOUND;
extern unsigned char TD_DEFAULTS_INSTALLED;
extern unsigned char TD_SMEM_DOING_FIRST;
extern unsigned char TD_SMEM_IN_PROGRESS;
extern unsigned char TLINK_SYNTAX;
extern unsigned char TLINK_X_MAPFILE;
extern unsigned char TLINK_INIT_SEGMENTS;
extern unsigned char TLINK_DEFAULT_MODE;
//endif
extern unsigned char TLINK_OUTTYPE_FOUND;
extern unsigned char ALL_EXPORTS_BY_ORDINAL;
extern unsigned char NEED_MDB_RECORD;
extern unsigned char DOING_CFG;
extern unsigned char SLASH_FOUND;
extern unsigned char DEBUG_ALL;
extern unsigned char KILL_NONRESIDENT_NAMES;
//if	fgh_dpmi
extern unsigned char FAULT_IN_PROGRESS;
extern unsigned char IO_BLKS_USED_UP;
//endif
extern unsigned char CTRL_C_FOUND;
extern unsigned char _NO_CANCEL_FLAG;
extern unsigned char CANCEL_REQUESTED;
//if	fg_symc
extern unsigned char COMENT_FOUND;
//endif
//if	fg_segm OR fg_pe
extern unsigned char HEAP_SIZE_FLAG;
extern unsigned char OBJECT_FLAGS_DEFINED;
//endif


extern unsigned char ANY_USE32;
extern unsigned char NOPACKDATA_FLAG;
extern unsigned char STORE_DSSICX_USE_ZERO;

//if	fg_pe
extern unsigned char PE_SUBSYSTEM_DEFINED;
extern unsigned char PE_SUBSYS_VERSION_DEFINED;
extern unsigned char PE_BASE_SPECIFIED;
extern unsigned char PE_BASE_FIXED;
extern unsigned char PE_LARGE_ADDRESS_AWARE;
extern unsigned char OUTPUT_PE;
extern unsigned char DOING_tls;
extern unsigned char GOT_tls_CLASS;

//endif


#if	fg_cvpack
extern unsigned char DOING_4K_ALIGN;
extern unsigned char CV_TYPES_VALID;
#endif

extern unsigned char LOD_SUPPLIED;
extern unsigned char DUP_NAME_REPORTED;
extern unsigned char OUTPUT_32BITS;
/*
if	fgh_win32
extern unsigned char HANDLES_EXPANDED;
endif

extern unsigned char MODEL_CONFLICT;

if	fgh_anythreads
extern unsigned char _HOST_THREADED;
extern unsigned char ASCIZ1_WAITING;
extern unsigned char ERROR1_WAITING;
endif
*/
extern unsigned char _FINAL_ABORTING;
extern unsigned char SUPPORT_AT_INDIRECT;
extern unsigned char AFTER_DEF_DONE;
extern unsigned char FUZZY_JUST_CHECK;
extern unsigned char ANY_PUBLICS;
extern unsigned char VERBOSE_OMF;
/*

		ALIGN	4

if	any_overlays

		PUBLIC	CACHE_REG_TABLE,CACHE_EMS_TABLE,CACHE_XMS_TABLE,CACHE_UMB_TABLE

		ALIGN	4

CACHE_EMS_TABLE CACHE_STRUCT<>
CACHE_XMS_TABLE CACHE_STRUCT<>
CACHE_REG_TABLE CACHE_STRUCT <>
CACHE_UMB_TABLE CACHE_STRUCT	<>

endif
THEADR_TEMP     DB      SYMBOL_TEXT_SIZE DUP(?)

if	fg_segm

		PUBLIC	IMPEXP_MOD,IMPEXP_NAM,IMPEXP_INTNAM,OS2_EXEHDR_START,OLD_EXE_HDR_SIZE,SEG_OS2_FLAGS,RESNAMES_SIZE
		PUBLIC	PADCODE,PADDATA,ENTRY_TABLE,MOVABLE_MASK,RESIDENT_STRUCTURE,IMPMOD_GARRAY,IMPMOD_HASH,FIRST_IMPMOD_GINDEX
		PUBLIC	NONRESIDENT_STRUCTURE,LOWEST_SEGMENT,HIGHEST_SEGMENT,ENTRY_OFFSET,IMP_MODNUM,IMP_ORDNUM,LAST_IMPMOD_GINDEX
		PUBLIC	EXP_ORDNUM,EXP_PWORDS,EXP_FLAGS,EXP_FLAGS_EXT,EXP_BOTH_FLAGS
		PUBLIC  PENT_STUFF,ENTRY_STUFF,ENTRYNAME_STUFF,IMPNAME_STUFF,ZERO_LENGTH_SEGMENTS
		PUBLIC	LATEST_PENT_GINDEX,NONRES_BYTES_LEFT,ENTRYNAME_BITS,IMPNAMES_SIZE,WINMAIN_GINDEX,LAST_ENTRYNAME_GINDEX
		PUBLIC	RESOURCE_FLAGS,RESOURCE_SIZE,NEXT_RESOURCE_MASTER_PTR,NEXT_RESOURCE_PTR,ENTRYNAME_COUNT,N_RTNLS
		PUBLIC	RESOURCE_BLOCK_MASTER_PTRS,RESOURCE_NAME_OFFSET,RESOURCE_STUFF,FIRST_RTNL_GINDEX,LAST_RTNL_GINDEX
		PUBLIC	RESOURCE_STUFF,RESOURCE_FILE_ADDR,RESOURCE_TYPE_ID,IMPLIB_PAGEBITS,N_RESTYPENAMES,N_IMPMODS
		PUBLIC	RESOURCE_TABLE_SIZE,TLINK_OUTTYPE,FIRST_ENTRYNAME_GINDEX,FIRST_RESNAME_GINDEX,LAST_RESNAME_GINDEX
		PUBLIC	RESOURCE_BYTES_SO_FAR,NONRESNAMES_SIZE,IMPNAME_GARRAY,ENTRYNAME_GARRAY,PENT_GARRAY,ENTRY_GARRAY
		PUBLIC	APPLOADER_SEGMENT_GINDEX,CURRENT_OFFSET,RESOURCE_NAMES_SIZE,EXPORT_TABLE_USE,IMPORT_TABLE_USE
		PUBLIC	IMPDEF_FILE_GINDEX,IMPLIB_COFF_FILE_GINDEX,IMPLIB_FILE_GINDEX,IMPLIB_PAGESIZE,ENTRYNAMES_TOTAL_LENGTH
		PUBLIC	RESNAME_GARRAY,RES_TYPENAME_HASH,RESTYPE_HASH,RESNAME_HASH,RESOURCE_HASHES,FIRST_PENT_GINDEX
		PUBLIC	RES_TYPENAME_HASH_TABLE_PTR,RESTYPE_HASH_TABLE_PTR,RESNAME_HASH_TABLE_PTR,RESTYPE_BYNAME_GINDEX
		PUBLIC	RESTYPE_BYORD_GINDEX,RESTYPE_N_BYNAME,RESTYPE_N_BYORD,RESTYPE_GARRAY,RES_TYPE_NAME_GARRAY,RTNL_GARRAY
		PUBLIC	LAST_PENT_GINDEX,SORTED_EXPORTS_USE

		.DATA?

IMPEXP_MOD	DB	SYMBOL_TEXT_SIZE+4 DUP(?)		;ALSO USED BY READ_RESOURCES FOR ERROR CONTROL...
IMPEXP_NAM	DB	INBUF_LEN+4 DUP(?)			;USED BY DEF_aPPLOADER
IMPEXP_INTNAM	DB	SYMBOL_TEXT_SIZE+4 DUP(?)		;XREF BUFFER NOT IN USE

		ALIGN	4

IMPMOD_HASH_TABLE	DD	IMPMOD_HASH_SIZE DUP(?)

		.DATA

		ALIGN	4

IMPMOD_GARRAY		STD_PTR_S <0,0,0,0,IMPMOD_POOL_GET,IMPMODS_EQU>
IMPNAME_GARRAY		STD_PTR_S <0,0,0,0,IMPNAME_POOL_GET,IMPNAMES_EQU>
ENTRYNAME_GARRAY	STD_PTR_S <0,0,0,0,ENTRYNAME_POOL_GET,ENTNAMES_EQU>
PENT_GARRAY		STD_PTR_S <0,0,0,0,PENT_POOL_GET,PENTS_EQU>
ENTRY_GARRAY		STD_PTR_S <0,0,0,0,ENTRY_POOL_GET,ENTRIES_EQU>
RESNAME_GARRAY		STD_PTR_S <0,0,0,0,RESNAME_POOL_GET,RESNAMES_EQU>
RESTYPE_GARRAY		STD_PTR_S <0,0,0,0,RESTYPE_POOL_GET,RESTYPES_EQU>
RES_TYPE_NAME_GARRAY	STD_PTR_S <0,0,0,0,RES_TYPENAME_POOL_GET,RES_TYPENAMES_EQU>
RTNL_GARRAY		STD_PTR_S <0,0,0,0,RTNL_POOL_GET,RTNLS_EQU>


IMPLIB_PAGESIZE		DD	16		;DEFAULT LIBRARY PAGESIZE
IMPMOD_HASH		DD	IMPMOD_HASH_SIZE
IMPMOD_HASH_TABLE_PTR	DD	IMPMOD_HASH_TABLE

if	page_size EQ 8K

RES_TYPENAME_HASH	DD	PRIME_1K
RESTYPE_HASH		DD	PRIME_512
RESNAME_HASH		DD	PRIME_512

RES_TYPENAME_HASH_TABLE_PTR	DD	0
RESTYPE_HASH_TABLE_PTR	DD	4K
RESNAME_HASH_TABLE_PTR	DD	6K

else

RES_TYPENAME_HASH	DD	PRIME_2K
RESTYPE_HASH		DD	PRIME_1K
RESNAME_HASH		DD	PRIME_1K

RES_TYPENAME_HASH_TABLE_PTR	DD	0
RESTYPE_HASH_TABLE_PTR	DD	8K
RESNAME_HASH_TABLE_PTR	DD	12K

endif


		.DATA?

RESOURCE_HASHES		DD	?
RESNAMES_SIZE		DD	?
IMPNAMES_SIZE		DD	?
NONRESNAMES_SIZE	DD	?
OS2_EXEHDR_START	DD	?
CURRENT_OFFSET		DD	?
ENTRYNAMES_TOTAL_LENGTH	DD	?
FIRST_ENTRYNAME_GINDEX	DD	?
LAST_ENTRYNAME_GINDEX	DD	?
ENTRYNAME_COUNT		DD	?
IMPLIB_PAGEBITS		DD	?

OLD_EXE_HDR_SIZE	DD	?
SEG_OS2_FLAGS		DD	?

PADCODE			DD	?
PADDATA			DD	?
IMPLIB_FILE_GINDEX	DD	?
IMPLIB_COFF_FILE_GINDEX	DD	?
IMPDEF_FILE_GINDEX	DD	?

FIRST_IMPMOD_GINDEX	DD	?
LAST_IMPMOD_GINDEX	DD	?
N_IMPMODS		DD	?

FIRST_PENT_GINDEX	DD	?
LAST_PENT_GINDEX	DD	?

RESTYPE_BYNAME_GINDEX	DD	?
RESTYPE_BYORD_GINDEX	DD	?
RESTYPE_N_BYNAME	DD	?
RESTYPE_N_BYORD		DD	?
N_RTNLS			DD	?
N_RESTYPENAMES		DD	?

FIRST_RTNL_GINDEX	DD	?
LAST_RTNL_GINDEX	DD	?
FIRST_RESNAME_GINDEX	DD	?
LAST_RESNAME_GINDEX	DD	?

EXPORT_TABLE_USE	DB	?
IMPORT_TABLE_USE	DB	?
			DW	?

WINMAIN_GINDEX		DD	?

ENTRY_TABLE		DD	32K/PAGE_SIZE * 16 DUP(?)	;PAGE_SIZE BLOCK FOR BUILDING ENTRIES

MOVABLE_MASK		DD	?	;
TLINK_OUTTYPE		DD	?

RESIDENT_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)
NONRESIDENT_STRUCTURE	DB	SIZE SEQ_STRUCT DUP(?)
LOWEST_SEGMENT		DD	?
HIGHEST_SEGMENT		DD	?
ENTRY_OFFSET	 	DD	?
LATEST_PENT_GINDEX	DD	?
ZERO_LENGTH_SEGMENTS	DD	?

IMP_MODNUM		DD	?
IMP_ORDNUM		DD	?

EXP_ORDNUM		DD	?

EXP_PWORDS		DB	?
EXP_FLAGS		DB	?
EXP_FLAGS_EXT		DB	?
        		DB	?
EXP_BOTH_FLAGS        	EQU     WORD PTR EXP_FLAGS

NONRES_BYTES_LEFT	DD	?
APPLOADER_SEGMENT_GINDEX	DD	?
ENTRYNAME_BITS		DD	?

;RESOURCE_TYPE		DW	?
;RESOURCE_TYPE_FLAG	DW	?
;RESOURCE_TYPE_GINDEX	DW	?
RESOURCE_TYPE_ID	DD	?

;RESOURCE_NAME		DW	?
;RESOURCE_NAME_FLAG	DW	?
;RESOURCE_NAME_GINDEX	DW	?

;RESOURCE_TYPE_NAME_GINDEX	DW	?

RESOURCE_FLAGS		DD	?
RESOURCE_SIZE		DD	?
NEXT_RESOURCE_MASTER_PTR	DD	?
NEXT_RESOURCE_PTR	DD	?
RESOURCE_TYPE_PTR	DD	?
RESOURCE_BLOCK_MASTER_PTRS	DD	?
RESOURCE_NAME_OFFSET	DD	?
RESOURCE_FILE_ADDR	DD	?
RESOURCE_TABLE_SIZE	DD	?
RESOURCE_NAMES_SIZE	DD	?
RESOURCE_BYTES_SO_FAR	DD	?
SORTED_EXPORTS_USE	DB	?
			DB	?	;AVAIL
			DW	?	;AVAIL

PENT_STUFF		ALLOCS_STRUCT	<>
ENTRYNAME_STUFF		ALLOCS_STRUCT	<>
IMPNAME_STUFF		ALLOCS_STRUCT	<>
ENTRY_STUFF		ALLOCS_STRUCT	<>
RESOURCE_STUFF		ALLOCS_STRUCT	<>

endif
*/

#if	fgh_outhreads
MYO_STRUCT MYO_STUFF[N_W_THREADS];
#else
MYO_STRUCT MYO_STUFF[4];	// just three in DOS (.MAP, .EXE, .TMP, .din)
#endif


#if	fgh_inthreads
MYI_STRUCT MYI_STUFF[N_R_THREADS];
#else
MYI_STRUCT MYI_STUFF[1];	// just one in DOS
#endif

/*
		align	4

if	fgh_anythreads
XOUTBUF 	DB	INBUF_LEN*2 DUP(?)	;USED BY XREF THREAD
EOUTBUF 	DB	INBUF_LEN*2 DUP(?)	;USED BY ERROR OUTPUT
else
XOUTBUF 	EQU	OUTBUF		;SAME BUFFER IN DOS...
EOUTBUF 	EQU	OUTBUF		;BUFFER FOR ERROR MESSAGES
endif


DTA		DB	44 DUP(?)


if	fg_winpack
		PUBLIC	WINPACK_OBJ_DEVICE

WINPACK_OBJ_DEVICE	DB	MYI_STRUCT.MYI_FILLBUF+4 DUP(?)

endif

if	fgh_win32

		PUBLIC	_STDOUT,STDIN,BEGIN_BSS,FINISH_BSS,BEGIN_DATA,FINISH_DATA,ERROR_ASCIZ,ME_TEXT

BEG_BSS		SEGMENT	PARA	'BSSBEG'

BEGIN_BSS	DD	?

BEG_BSS		ENDS

END_BSS		SEGMENT PARA	'BSSEND'

FINISH_BSS	DD	?

END_BSS		ENDS

BEG_DATA	SEGMENT	PARA	'DATABEG'

BEGIN_DATA	DD	?

BEG_DATA		ENDS

END_DATA	SEGMENT PARA	'DATAEND'

FINISH_DATA	DD	?

END_DATA	ENDS


*/

extern void *_STDOUT;
extern void *STDIN;

extern char ME_TEXT[256];
extern char ERROR_ASCIZ[256];

/*

endif

STACK		SEGMENT DWORD STACK 'STACK'

		ALIGN	4
if	0;fgh_os2
			DB	4K DUP(?)

MAP_THREAD_STACK	LABEL	BYTE

endif

STACK		ENDS

DGROUP		GROUP	STACK

.DATA?

STARTING_ESP		DD	?

FIX2_TINDEX		DD	?
FIX2_FINDEX		DD	?
FIX2_TT			DD	?
FIX2_FF			DD	?
FIX2_OFFSET		DD	?
FIX2_LOC		DD	?
FIX2_SEGMOD_STUFF	SEGMOD_STRUCT<>
FIX2_SM_LAST_DAT	DD	?
FIX2_SEGMENT_STUFF	SEGMENT_STRUCT<>
FIX2_FIXUPP_STUFF	FIXUPP_HEADER_TYPE<>
			DD	?		;FOR FARCALL...

FIX2_LDATA_STUFF	LDATA_HEADER_TYPE<>
FIX2_LDATA_LOC		DD	?
FIX2_LDATA_PTR		DD	?
FIX2_LDATA_LOG		DD	?
FIX2_LDATA_BASE		DD	?
FIX2_LDATA_EOR		DD	?

FIX2_TOFFSET		DD	?
FIX2_TFRAME		DD	?
FIX2_OS2_TFLAGS		DD	?
FIX2_EXEPACK_BASE	DD	?
*/

extern SEGMENT_STRUCT *FIX2_SEG_GINDEX;		// USED FOR TLS

/*
FIX2_OS2_TNUMBER	EQU	FIX2_TFRAME

FIX2_FFRAME		DD	?

FIX2_OS2_FNUMBER	EQU	FIX2_FFRAME

FIX2_TTYPE		DB	?
FIX2_FTYPE		DB	?
			DW	?

FIX2_LDATA_SEGMENT_GINDEX	DD	?
FIX2_FIXUPP_BASE	DD	?
FIX2_FIXUPP_LOG		DD	?
FIX2_FIXUPP_EOR		DD	?
FIX2_NEW_SEGMOD_GINDEX	DD	?
FIX2_STACK_LARGEST	DD	?
FIX2_STACK_DELTA	DD	?
FIX2_STACK_DELTA_ADDER	DD	?
FIX2_SKIP_BYTES		DD	?

FIX2_TARG_TABLE		DD	?
FIX2_RELOC_OFFSET	DD	?

;FIX2_FC_LENGTH		EQU	FIX2_

FIX2_SM_BASE_SEG_GINDEX	EQU	(FIX2_SEGMOD_STUFF._SM_BASE_SEG_GINDEX)
FIX2_SM_NEXT_SEGMOD_GINDEX	EQU	FIX2_SEGMOD_STUFF._SM_NEXT_SEGMOD_GINDEX
FIX2_SM_START		EQU	FIX2_SEGMOD_STUFF._SM_START
FIX2_SM_LEN		EQU	FIX2_SEGMOD_STUFF._SM_LEN
FIX2_SM_FIRST_DAT	EQU	FIX2_SEGMOD_STUFF._SM_FIRST_DAT
FIX2_SM_SECTION_GINDEX	EQU	FIX2_SEGMOD_STUFF._SM_SECTION_GINDEX
FIX2_SM_PLTYPE		EQU	FIX2_SEGMOD_STUFF._SM_PLTYPE
FIX2_SM_FLAGS_2		EQU	FIX2_SEGMOD_STUFF._SM_FLAGS_2
FIX2_SM_ALIGN		EQU	FIX2_SEGMOD_STUFF._SM_ALIGN
FIX2_SM_FLAGS		EQU	FIX2_SEGMOD_STUFF._SM_FLAGS
FIX2_SM_MODULE_CSEG_GINDEX	EQU	FIX2_SEGMOD_STUFF._SM_MODULE_CSEG_GINDEX

FIX2_SEG_NEXT_HASH_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_NEXT_HASH_GINDEX
FIX2_SEG_NEXT_SEG_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_NEXT_SEG_GINDEX
FIX2_SEG_CLASS_GINDEX		EQU	FIX2_SEGMENT_STUFF._SEG_CLASS_GINDEX
FIX2_SEG_GROUP_GINDEX		EQU	FIX2_SEGMENT_STUFF._SEG_GROUP_GINDEX
FIX2_SEG_OFFSET			EQU	FIX2_SEGMENT_STUFF._SEG_OFFSET
FIX2_SEG_OS2_FLAGS		EQU	FIX2_SEGMENT_STUFF._SEG_OS2_FLAGS
FIX2_SEG_OS2_NUMBER		EQU	FIX2_SEGMENT_STUFF._SEG_OS2_NUMBER
FIX2_SEG_FIRST_SEGMOD_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_FIRST_SEGMOD_GINDEX
FIX2_SEG_LAST_SEGMOD_GINDEX	EQU	FIX2_SEGMENT_STUFF._SEG_LAST_SEGMOD_GINDEX
;FIX2_SEG_SECTION_GINDEX		EQU	FIX2_SEGMENT_STUFF._SEG_SECTION_GINDEX
;FIX2_SEG_PLTYPE			EQU	FIX2_SEGMENT_STUFF._SEG_PLTYPE
FIX2_SEG_32FLAGS		EQU	FIX2_SEGMENT_STUFF._SEG_32FLAGS
FIX2_SEG_COMBINE		EQU	FIX2_SEGMENT_STUFF._SEG_COMBINE
FIX2_SEG_TYPE			EQU	FIX2_SEGMENT_STUFF._SEG_TYPE

FIX2_SEG_LEN			EQU	FIX2_SEGMENT_STUFF._SEG_LEN
FIX2_SEG_FRAME			EQU	FIX2_SEGMENT_STUFF._SEG_FRAME

FIX2_FC_SEGMOD_GINDEX		EQU	FIX2_FIXUPP_STUFF+ FARCALL_HEADER_TYPE._FC_SEGMOD_GINDEX
FIX2_FC_LENGTH			EQU	FIX2_FIXUPP_STUFF+ FARCALL_HEADER_TYPE._FC_LENGTH
FIX2_FC_BLOCK_BASE		EQU	FIX2_FIXUPP_STUFF+ FARCALL_HEADER_TYPE._FC_BLOCK_BASE

FIX2_LD_NEXT_LDATA		EQU	FIX2_LDATA_STUFF._LD_NEXT_LDATA
FIX2_LD_TYPE			EQU	FIX2_LDATA_STUFF._LD_TYPE
FIX2_LD_BLOCK_BASE		EQU	FIX2_LDATA_STUFF._LD_BLOCK_BASE
FIX2_LD_LENGTH			EQU	FIX2_LDATA_STUFF._LD_LENGTH
FIX2_LD_OFFSET			EQU	FIX2_LDATA_STUFF._LD_OFFSET

FIX2_FH_NEXT_FIXUPP		EQU	FIX2_FIXUPP_STUFF._FH_NEXT_FIXUPP
FIX2_FH_TYPE			EQU	FIX2_FIXUPP_STUFF._FH_TYPE
FIX2_FH_XTRA			EQU	FIX2_FIXUPP_STUFF._FH_XTRA
FIX2_FH_BLOCK_BASE		EQU	FIX2_FIXUPP_STUFF._FH_BLOCK_BASE
FIX2_FH_LENGTH			EQU	FIX2_FIXUPP_STUFF._FH_LENGTH

FIX2_IMP_OFFSET 	DD	?
FIX2_IMP_MODULE 	DD	?
FIX2_IMP_FLAGS		EQU	(FIX2_OS2_TNUMBER)

FIX2_TFRAME_SEG		EQU	(FIX2_TFRAME)


		PUBLIC	FIX2_TINDEX,FIX2_FINDEX,FIX2_TT,FIX2_FF,FIX2_OFFSET,FIX2_LOC,FIX2_SEGMOD_STUFF,FIX2_LDATA_LOC,FIX2_TOFFSET
		PUBLIC	FIX2_FFRAME,FIX2_SM_BASE_SEG_GINDEX,FIX2_SM_NEXT_SEGMOD_GINDEX,FIX2_SM_START,FIX2_SM_LEN,FIX2_SM_FIRST_DAT
		PUBLIC	FIX2_SM_SECTION_GINDEX,FIX2_SM_PLTYPE,FIX2_SM_FLAGS_2,FIX2_SM_ALIGN,FIX2_SM_FLAGS,FIX2_SM_MODULE_CSEG_GINDEX
		PUBLIC	FIX2_SEGMENT_STUFF,FIX2_SEG_NEXT_HASH_GINDEX,FIX2_SEG_NEXT_SEG_GINDEX,FIX2_SEG_CLASS_GINDEX,FIX2_SEG_GROUP_GINDEX
		PUBLIC	FIX2_SEG_OFFSET,FIX2_SEG_OS2_FLAGS,FIX2_SEG_OS2_NUMBER,FIX2_SEG_32FLAGS,FIX2_FC_BLOCK_BASE
		PUBLIC	FIX2_SEG_COMBINE,FIX2_SEG_TYPE,FIX2_SEG_LEN,FIX2_SEG_FRAME,FIX2_TTYPE,FIX2_FTYPE,FIX2_LDATA_SEGMENT_GINDEX
		PUBLIC	FIX2_FIXUPP_BASE,FIX2_FIXUPP_EOR,FIX2_FIXUPP_LOG,FIX2_LDATA_LOG,FIX2_OS2_TNUMBER,FIX2_OS2_TFLAGS,FIX2_TFRAME
		PUBLIC	FIX2_OS2_FNUMBER,FIX2_FC_LENGTH,FIX2_FC_SEGMOD_GINDEX,FIX2_FIXUPP_STUFF,FIX2_LDATA_STUFF,FIX2_LD_NEXT_LDATA
		PUBLIC	FIX2_LD_TYPE,FIX2_LD_LENGTH,FIX2_LD_OFFSET,FIX2_FH_NEXT_FIXUPP,FIX2_FH_TYPE,FIX2_FH_XTRA
		PUBLIC	FIX2_FH_LENGTH,FIX2_IMP_OFFSET,FIX2_IMP_MODULE,FIX2_IMP_FLAGS,FIX2_LDATA_PTR,FIX2_LDATA_BASE
		PUBLIC	FIX2_LDATA_EOR,FIX2_TFRAME_SEG,FIX2_SM_LAST_DAT,FIX2_EXEPACK_BASE,FIX2_SEG_GINDEX
		PUBLIC	FIX2_TARG_TABLE,FIX2_NEW_SEGMOD_GINDEX,FIX2_STACK_LARGEST,FIX2_STACK_DELTA,FIX2_STACK_DELTA_ADDER
		PUBLIC	FIX2_SKIP_BYTES,FIX2_RELOC_OFFSET,FIX2_LD_BLOCK_BASE,FIX2_FH_BLOCK_BASE

		PUBLIC	ALLOCS_TABLES,ALLOCS_TABLES_LEN

		.DATA

ALLOCS_TABLES	LABEL	DWORD
		DD	LNAME_STUFF,LNAME_TXT
		DD	RELOC_STUFF,RELOC_TXT
		DD	SSYM_STUFF,SSYM_TXT
		DD	P1ONLY_STUFF,P1ONLY_TXT
		DD	TILLMIDDLE_STUFF,TILLMIDDLE_TXT
		DD	SEGMENT_STUFF,SEGMENT_TXT
if	fg_segm
		DD	PENT_STUFF,PENT_TXT
		DD	ENTRYNAME_STUFF,ENTRYNAME_TXT
		DD	IMPNAME_STUFF,IMPNAME_TXT
		DD	ENTRY_STUFF,ENTRY_TXT
;		DW	RESOURCE_NAME_STUFF,RESOURCE_NAME_TXT
;		DW	RESOURCE_TYPE_STUFF,RESOURCE_TYPE_TXT
		DD	RESOURCE_STUFF,RESOURCE_TXT
endif
if	fg_td
		DD	TD_NAME_STUFF,TD_NAME_TXT
		DD	TD_GLOCAL_STUFF,TD_GLOCAL_TXT
		DD	TD_GTYPE_STUFF,TD_GTYPE_TXT
		DD	TD_GSMEM_STUFF,TD_GSMEM_TXT
		DD	TD_GCLASS_STUFF,TD_GCLASS_TXT
endif
if	alloc_support
		DD	PUBALLOC_STUFF,PUBALLOC_TXT
		DD	LIBALLOC_STUFF,LIBALLOC_TXT
endif
if      fg_pe
                DD      PAGE_RELOC_STUFF,PAGE_RELOC_TXT
endif
if      fg_cvpack
                DD      CV_GSYM_STUFF,CV_GSYM_TXT
                DD      CV_LTYPE_STUFF,CV_LTYPE_TXT
                DD      CV_GTYPE_STUFF,CV_GTYPE_TXT
endif

ALLOCS_TABLES_LEN	EQU	($-ALLOCS_TABLES)/4

if	debug

DBB		EQU	<DB>

else

DBB		EQU	<EQU 1;>

endif

LNAME_TXT	DBB	LENGTH LNAME_TXT-1,'Lname_Stuff'
RELOC_TXT	DBB	LENGTH RELOC_TXT-1,'Reloc Stuff'
SSYM_TXT	DBB	LENGTH SSYM_TXT-1,'Symbols Stuff'
P1ONLY_TXT	DBB	LENGTH P1ONLY_TXT-1,'Pass1 Stuff'
TILLMIDDLE_TXT	DBB	LENGTH TILLMIDDLE_TXT-1,'Middle Stuff'
SEGMENT_TXT	DBB	LENGTH SEGMENT_TXT-1,'Segment Stuff'
if	fg_segm
PENT_TXT	DBB	LENGTH PENT_TXT-1,'Pent Stuff'
ENTRYNAME_TXT	DBB	LENGTH ENTRYNAME_TXT-1,'Entryname Stuff'
IMPNAME_TXT	DBB	LENGTH IMPNAME_TXT-1,'ImpName Stuff'
ENTRY_TXT	DBB	LENGTH ENTRY_TXT-1,'Entry Stuff'
RESOURCE_NAME_TXT DBB	LENGTH RESOURCE_NAME_TXT-1,'Resource Name Stuff'
RESOURCE_TYPE_TXT DBB	LENGTH RESOURCE_TYPE_TXT-1,'Resource Type Stuff'
RESOURCE_TXT	DBB	LENGTH RESOURCE_TXT-1,'Resource Stuff'
endif
if	fg_td
TD_NAME_TXT	DBB	LENGTH TD_NAME_TXT-1,'TD Names'
TD_GLOCAL_TXT	DBB	LENGTH TD_GLOCAL_TXT-1,'TD Locals'
TD_GTYPE_TXT	DBB	LENGTH TD_GTYPE_TXT-1,'TD Types'
TD_GSMEM_TXT	DBB	LENGTH TD_GSMEM_TXT-1,'TD Smems'
TD_GCLASS_TXT	DBB	LENGTH TD_GCLASS_TXT-1,'TD Classes'
endif
if      fg_pe
PAGE_RELOC_TXT  DBB     LENGTH PAGE_RELOC_TXT-1,'PE Page Relocs'
endif
if      fg_cvpack
CV_GSYM_TXT     DBB     LENGTH CV_GSYM_TXT-1,'CV Global Syms'
CV_LTYPE_TXT    DBB     LENGTH CV_LTYPE_TXT-1,'CV Local Types'
CV_GTYPE_TXT    DBB     LENGTH CV_GTYPE_TXT-1,'CV Global Types'
endif


if	fg_td
PARALLELS		SEGMENT	WORD PUBLIC	'DATA'

PARALLEL_TABLES_LEN	EQU	($-PARALLEL_TABLES)/2

PARALLELS		ENDS
endif

*/
